首页 文章

npm使用laravel 5.4在VM上运行dev install错误

提问于
浏览
0

我正在尝试开始使用npm和vue进行前端开发,但是很难开始 . 我正在使用scotchbox pro,它只是一个用于开发的Vagrant盒子 . 我在Windows 10上运行这个VM并重新安装了laravel 5.4 .

默认的package.json就在那里(https://github.com/laravel/laravel/blob/master/package.json),我一直试图在过去几天没有成功的情况下运行npm install .

我不确定在这个问题上我应该寻找什么支持,因为它可能是laravel,npm或我的VM . 我很难找到一个如何开始运行的可靠资源!

这是我得到的npm run dev输出:

@ dev /var/www
 npm run development


 @ development /var/www
 cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress -hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: 1: cross-env: not found

npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.10.3/bin/node" "/home/vagrant/.nvm/versions/node/v6.10.3/bin/npm" "run" "development"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/npm-debug.log

npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.10.3/bin/node" "/home/vagrant/.nvm/versions/node/v6.10.3/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/npm-debug.log

1 回答

  • 0

    我发现更改我的Vagrant文件配置修复了此问题,因为它是文件夹权限问题 .

    config.vm.synced_folder“ . ”,“/ var / www”,:nfs => {:mount_options => [“dmode = 777”,“fmode = 666”]}

相关问题