运行错误" npm install"在克隆的vuejs项目

时间:2018-02-11 19:44:41

标签: ubuntu npm vue.js npm-install grpc

Nodejs v4.2.6, Npm v3.5.2

最近系统重置了Windows 10,然后使用双启动安装了Ubuntu。我对Ubuntu操作系统比较陌生,只知道足够多的Linux命令来帮助我。当我在我的VueJs项目目录中运行npm install时,我得到了这个:

> grpc@1.9.0 install /home/george/code/bedal/portal.barcodexchange.com/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/usr/bin/env: ‘node’: No such file or directory
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.3
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! grpc@1.9.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the grpc@1.9.0 install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
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 grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/code/bedal/portal.barcodexchange.com/npm-debug.log

尽管我尝试运行错误" npm run dev"在同一目录中,这就是我得到的:

> barcode_portal@1.0.0 dev /home/george/code/bedal/portal.barcodexchange.com
> node build/dev-server.js

sh: 1: node: not found

npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! barcode_portal@1.0.0 dev: `node build/dev-server.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the barcode_portal@1.0.0 dev script 'node build/dev-server.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 barcode_portal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs barcode_portal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls barcode_portal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/code/bedal/portal.barcodexchange.com/npm-debug.log

这是我的文件目录在VueJs项目中的样子:

.   
.babelrc  
config     
.editorconfig  
.eslintrc.js   
.firebaserc  
.gitignore  
node_modules   
package.json   
README.md  
.vscode
..  
build     
debug.log  
.eslintignore  
firebase.json  
.git         
index.html  
npm-debug.log  
.postcssrc.js  
src        
yarn.lock

请注意,该项目在Windows安装上运行良好,但现在我无法在Ubuntu上启动所有内容。非常感谢帮助,谢谢你的时间。

1 个答案:

答案 0 :(得分:0)

您需要在Roland指出的系统上安装node.js.节点有方向here

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

或者(在我看来,最好的方法)是使用NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

然后

nvm install node && nvm use node

这允许您在需要时快速切换节点版本。