部署到App Engine会产生错误与吞咽?

我写在terminal上像往常一样部署:

gcloud app deploy 

我得到的错误:

 Application startup error: > meanjs@0.5.0 start /app > gulp sh: 1: gulp: not found npm ERR! Linux 3.16.0-4-amd64 npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start" npm ERR! node v6.9.5 npm ERR! npm v3.10.10 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! meanjs@0.5.0 start: `gulp` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the meanjs@0.5.0 start script 'gulp'. 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 meanjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! gulp npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs meanjs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls meanjs npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /app/npm-debug.log 

使用Mean.js: https : //github.com/meanjs/mean

找不到npmdebugging日志。


PS:我确实在全球范围内安装了gulp

 $ sudo npm install gulp-cli -g 

首先,你不需要使用sudo。

您可以通过在terminal中键入以下内容来修复错误:

 npm config set prefix ~/npm # add this to your .bashrc (or .zshrc or whatever you are using) export PATH="$PATH:$HOME/npm/bin" 

然后重新安装没有sudo。

希望这可以帮助!

看来你没有在你的服务器上安装gulp。 尝试在您的服务器上用服务器上的NodeJS和npm重新安装gulp,然后用所需的软件包安装gulp它可能会解决错误。

请检查错误,您可能会find一个解决scheme

npm ERR! 确保你已经安装了最新版本的node.js和npm。

在你的项目中安装gulp

npm安装gulp

全球安装gulp。

npm安装gulp -g

这是NODE_ENV的问题。

它不会在生产中find吞噬依赖,所以我不得不改变我的package.json,把所有东西放在“依赖”中,而不是在“dev_dependencies”中使用。