node.js - 部署到 App Engine 会产生 gulp 错误?

标签 node.js google-app-engine gulp google-cloud-platform

我在终端中编写的内容以像往常一样部署:

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

找不到 npm 调试日志。


附注:我确实在全局安装了 gulp

$ sudo npm install gulp-cli -g

最佳答案

首先,您不需要使用 sudo。

您可以通过在终端中输入以下内容来修复您的错误:

npm config set prefix ~/npm

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

然后在没有 sudo 的情况下重新安装。

希望这对您有所帮助!

关于node.js - 部署到 App Engine 会产生 gulp 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42180957/

相关文章:

mysql - Sequelize 获取查询的所有数据而不执行我的条件 'where'

javascript - 如何在express.js中使用嵌套中间件

node.js - 使用 Mongoose Dynamic Populate 得到意想不到的结果

google-app-engine - 如何在 Google App Engine (Java) 中注释嵌入式对象的集合?

java - 对象化 : How to Migrate an Entity with a String ID to a Long ID

git - 如何在 git 中处理跟踪生成的文件?

javascript - 我应该如何将用户名和密码发送到服务器?

python - Google App Engine 不提供静态文件

maven - 在 IntelliJ 中运行 Gulp 和 Redploy

node.js - 为什么 css-nano(几乎)不起作用?