克隆的 vuejs 项目 运行 "npm install" 时出错
Errors when running "npm install" on cloned vuejs project
Nodejs v4.2.6,
Npm v3.5.2
最近对 windows 10 进行了系统重置,然后使用双引导安装了 Ubuntu。我对 Ubuntu 操作系统比较陌生,只知道足够的 Linux 命令让我四处走动。当我 运行 npm install 在我的 VueJs 项目目录中时,我得到这个:
> 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
尽管我在同一目录中尝试 运行ning "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 上启动所有内容。非常感谢您的帮助,感谢您的宝贵时间。
您需要按照 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
这允许您在需要时快速切换节点版本。
Nodejs v4.2.6, Npm v3.5.2
最近对 windows 10 进行了系统重置,然后使用双引导安装了 Ubuntu。我对 Ubuntu 操作系统比较陌生,只知道足够的 Linux 命令让我四处走动。当我 运行 npm install 在我的 VueJs 项目目录中时,我得到这个:
> 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
尽管我在同一目录中尝试 运行ning "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 上启动所有内容。非常感谢您的帮助,感谢您的宝贵时间。
您需要按照 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
这允许您在需要时快速切换节点版本。