【问题标题】:Deploying to App Engine generates error with gulp?部署到 App Engine 会产生 gulp 错误?
【发布时间】:2017-02-22 20:10:50
【问题描述】:

我在终端写的照常部署:

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 调试日志。


P.S.:我确实使用

全局安装了 gulp
$ sudo npm install gulp-cli -g

【问题讨论】:

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


    【解决方案1】:

    首先,您不需要使用 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 重新安装。

    希望这会有所帮助!

    【讨论】:

      【解决方案2】:

      您的服务器中似乎没有安装 gulp。尝试在服务器上使用 NodeJS 和 npm 在服务器中重新安装 gulp,然后使用所需的包安装 gulp,它可能会解决错误。

      请查看错误您可能会找到解决方案

      npm 错误!确保您拥有最新版本的 node.js 和 npm 已安装。

      在你的项目中安装 gulp

      npm install gulp

      全局安装 gulp。

      npm install gulp -g

      【讨论】:

        【解决方案3】:

        这是 NODE_ENV 的问题。

        它在生产中找不到 gulp 依赖项,所以我不得不更改我的 package.json 并将所有内容放在“依赖项”中,而不是在“dev_dependencies”中使用一些。

        【讨论】:

        • 完全相同的问题,但这并不能解决它。你在 NODE_ENV 上设置了什么值?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-25
        • 1970-01-01
        • 2018-12-16
        相关资源
        最近更新 更多