Deploying to App Engine generates error with gulp? - node.js

What I wrote in terminal to deploy as usual:
gcloud app deploy
The error I get:
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
Using Mean.js : https://github.com/meanjs/mean
Can't find the npm debug log.
P.S.: I did install gulp globally with
$ sudo npm install gulp-cli -g

First, you don't need to use sudo.
You can fix your error by typing this in terminal:
npm config set prefix ~/npm
# add this to your .bashrc (or .zshrc or whatever you are using)
export PATH="$PATH:$HOME/npm/bin"
Then re-install without sudo.
Hope this helps!

It seems that you did not install gulp in your server. Try to re-install gulp in your server with NodeJS and npm on your server and then install gulp with required packages it may resolve an error.
Please review an error you may find a solution
npm ERR! Make sure you have the latest version of node.js and npm
installed.
Install gulp in your project
npm install gulp
Install gulp globally.
npm install gulp -g

It was an issue with the NODE_ENV.
It would not find the gulp dependency in production, so I had to change my package.json and put everything in "dependencies" instead of using some in "dev_dependencies".

Related

npm install fails with npm.cmd: command not found

We currently do sudo npm i instead of npm i to circumvent this issue. Our Ubuntu team members can't do this however because nvm isn't installed for root. NVM and N both have this same issue.
geoyws-mbp:ifca-construction-react geoyws$ npm i
> ifca-construction-react#0.1.0 prepare /Users/geoyws/work/src/ifca/ifca-react/src/modules/ifca-construction-react
> npm.cmd run compile
sh: npm.cmd: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! ifca-construction-react#0.1.0 prepare: `npm.cmd run compile`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the ifca-construction-react#0.1.0 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/geoyws/.npm/_logs/2019-10-03T09_40_46_545Z-debug.log
The problem was that one of our engineers changed our npm start script from npm run compile to npm.cmd run compile in our package.json. Either that or create-react-app did that, which is very unwise because people work with various OSes on the same codebase.

Installing node-sass errors with 'ELIFECYCLE'

I install npm and work, but I can not install node-sass. The next message following;
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "scss"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! one#1.0.0 scss: `node-sass -watch scss -o css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the one#1.0.0 scss script 'node-sass -watch scss -o css'.
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 one package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-sass -watch scss -o css
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs one
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls one
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/maty/Desktop/MyFirstProyect/npm-debug.log
I install sass use;
npm install node-sass
sudo npm install -g sass
I checked the version, I made an easy sass code example.
Someone, could you help me?
Check your node version and node-sass version.
Mine was "node-sass":"4.5.3" node version i changed that too "node-sass":"^4.6.0"
(change this based on your node version by referring the below attached image) in package.json dev dependency and ran npm install. Installation was success and working fine.try this

npm start doesn't work after i do npm unlink

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/myName/.nvm/versions/node/v5.12.0/bin/node" "/Users/myName/.nvm/versions/node/v5.12.0/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! appName#1.5.1 start: `ember server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appName start script 'ember server'.
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 appName package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ember server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs appName
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls appName
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/myName/Documents/Dev/ember-project-name/npm-debug
I linked gooey, one of my projects, to another project: ember, now i wanted to unlink them
so i did npm unlink
then npm start didn't work no matter what i did.
things I've tried:
npm install several times,
bower install several times,
rm -rf node_modules
rm -rf bower_components
npm install several times
npm start kept giving errors, like can't find some file in gooey or tell author that ember server failed
The solution:
option 1:
first do npm link so that it installs everything it needs
then npm install, then npm start will start working again.
option2:
if you want to unlink, do:
npm unlink
npm update
npm start
that should work too.
try npm install again before npm start if you have problems.

Using npm to install grunt on nodeenv results in findup-sync error

After establishing a node virtualenv using nodeenv, I use source /bin/activate
to switch into the correct directory, update npm, and execute
npm install -g grunt or npm install -g grunt-cli and I recieve the same error:
npm ERR! Linux 3.13.0-53-generic
npm ERR! argv "node" "/home/{redacted-home-dir}/NodeProjects/vue/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.4
npm ERR! npm v2.11.1
npm ERR! file /home/{redacted-home-dir}/.npm/findup-sync/0.1.3/package/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: /home/{redacted-home-dir}/.npm/findup-sync/0.1.3/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! /home/{redacted-home-dir}/NodeProjects/vue/npm-debug.log
A similar error was noted on the findup-sync Github, but this the most recent edition of npm.
Grunt's package.json says "approximately 0.1.2" according to the npm docs.
I also have tried installing findup-sync independently, to no avail.
Other details about my computer: Linux (Debian/Ubuntu 14.04). 64bit.
You have maybe a corrupted cache : npm cache clean

Unable to run server with node

I'm new to node js and programming. I have problems running the server. This is what I did
1) Install Express
sudo npm install -g express-generator
2) Install dependencies
cd . && sudo npm install
When I run in terminal:
node app.js OR node app
There is no response on whether the server is running and chrome says that no data is received when I route to localhost:3000. I later found out that the correct way was to run
npm start
instead, but I got this:
npm ERR! express#0.0.1 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the express#0.0.1 start script.
npm ERR! This is most likely a problem with the express package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls express
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "start"
npm ERR! cwd /Users/apple/Documents/javascript/express
npm ERR! node -v v0.11.14-pre
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/apple/Documents/javascript/express/npm-debug.log
npm ERR! not ok code 0
What's wrong?
What did you get in return when you run node app.js?
Also, make sure your app.js is inside the folder you are at.
Express generator does not generate an express for you, it only installs express tool to generate projects.
sudo npm install -g express-generator
Once express-generator is installed; issue express to generate the project for you;
$ express myapp
// generate myapp with initial express files
$ cd myapp && npm install
// now you run the app
$ ./bin/www
// or
$ npm start

Resources