`npm run gulp` can not find module 'gulp-shell'? - node.js

I've deleted node modules folder and installed npm using npm install command. My gulpfile.js is also perfect because other people are working perfectly with this config, even I did with this config from my another machine. But when I try to run npm run gulp from current machine it shows below errors.
Fahads-MacBook-Pro:dark-web jim$ npm run gulp
> jetaport#1.0.0 gulp /Users/jim/Documents/JETAPORT/dark-web
> gulp
module.js:327
throw err;
^
Error: Cannot find module 'gulp-shell'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/jim/Documents/JETAPORT/dark-web/gulpfile.js:6:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "gulp"
npm ERR! node v4.4.2
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! jetaport#1.0.0 gulp: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jetaport#1.0.0 gulp script 'gulp'.
npm ERR! This is most likely a problem with the jetaport 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 jetaport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls jetaport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jim/Documents/JETAPORT/dark-web/npm-debug.log
And here is the package.json file
{
"name": "jetaport",
"version": "1.0.0",
"description": "The Jetaport Gulp dependencies.",
"main": "index.js",
"author": "Alexander Khost",
"repository": {
"type": "git",
"url": "git://github.com/akhost/Jetaport.git"
},
"license": "ISC",
"dependencies": {
"autoprefixer": "^6.3.1",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"bower": "^1.7.2",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-cssnano": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-postcss": "^6.0.1",
"imagemin-pngquant": "^4.2.0",
"laravel-elixir": "^5.0.0",
"pixrem": "^3.0.0",
"postcss-conditionals": "^2.0.0",
"postcss-each": "^0.9.1",
"postcss-import": "^7.1.3",
"postcss-math": "0.0.1",
"postcss-mixins": "^4.0.1",
"postcss-nested": "^1.0.0",
"postcss-reporter": "^1.3.0",
"postcss-scss": "^0.1.3",
"postcss-simple-extend": "^1.0.0",
"postcss-simple-vars": "^1.1.0",
"precss": "^1.3.0",
"yargs": "^4.4.0"
},
"bugs": {
"url": "https://github.com/akhost/Jetaport/issues"
},
"homepage": "https://github.com/akhost/Jetaport#readme",
"directories": {
"test": "tests"
},
"devDependencnpm ies": {
"gulp-notify": "^2.2.0"
},
"scripts": {
"gulp": "gulp",
"bower": "bower"
},
"devDependencies": {
"gulp": "^3.9.1"
}
}

Your package.json is missing the gulp-shell package. You have to install it with npm install --save gulp-shell (or --save-dev if you want to put it under devDependencies). Not sure how others got it working, but I'm pretty confident they have installed it themselves, similarly to what I've suggested, without the save flag, which is the reason it's missing in package.json.

Related

NodeJS and Express app error after deploy on azure web apps

After deploying node app with azure web app. An error appers about npm start. Project structure is simple app.js is like index.js.
App cant find a moongose module /helpers/simpleValidator.
I set up those variables in azure app config.
Environments variables
Logs
2022-08-21T02:25:53.042096825Z {"code":"MODULE_NOT_FOUND","level":"error","message":"Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js","requireStack":["/home/site/wwwroot/node_modules/mongoose/lib/schematype.js","/home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js","/home/site/wwwroot/node_modules/mongoose/lib/document.js","/home/site/wwwroot/node_modules/mongoose/lib/index.js","/home/site/wwwroot/node_modules/mongoose/index.js","/home/site/wwwroot/models/user.js","/home/site/wwwroot/routes/user.js","/home/site/wwwroot/startup/routes.js","/home/site/wwwroot/app.js"],"stack":"Error: Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js\n at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n at Function.Module._load (node:internal/modules/cjs/loader:778:27)\n at Module.require (node:internal/modules/cjs/loader:1005:19)\n at require (node:internal/modules/cjs/helpers:102:18)\n at Object. (/home/site/wwwroot/node_modules/mongoose/lib/schematype.js:13:27)\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n at Module.load (node:internal/modules/cjs/loader:981:32)\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n at Module.require (node:internal/modules/cjs/loader:1005:19)"}
2022-08-21T02:25:53.082240581Z npm info lifecycle t******#1.0.0~start: Failed to exec start script
2022-08-21T02:25:53.120536311Z npm ERR! code ELIFECYCLE
2022-08-21T02:25:53.120575311Z npm ERR! errno 1
2022-08-21T02:25:53.120582912Z npm ERR! t******#1.0.0 start: `node app.js`
2022-08-21T02:25:53.120587512Z npm ERR! Exit status 1
2022-08-21T02:25:53.120591912Z npm ERR!
2022-08-21T02:25:53.120596112Z npm ERR! Failed at the t******#1.0.0 start script.
2022-08-21T02:25:53.120600812Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-08-21T02:25:53.213953705Z npm timing npm Completed in 18684ms
2022-08-21T02:25:53.213985605Z
2022-08-21T02:25:53.213992305Z npm ERR! A complete log of this run can be found in:
2022-08-21T02:25:53.213997205Z npm ERR! /root/.npm/_logs/2022-08-21T02_25_53_117Z-debug.log
2022-08-21T21:37:11.468408816Z npm ERR! taap#1.0.0 start: `node app.js`
2022-08-21T21:37:11.469692437Z npm ERR! Exit status 1
2022-08-21T21:37:11.476509148Z npm ERR!
2022-08-21T21:37:11.477776868Z npm ERR! Failed at the taap#1.0.0 start script.
2022-08-21T21:37:11.478919887Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-08-21T21:37:11.555158523Z npm timing npm Completed in 9802ms
2022-08-21T21:37:11.558920984Z
2022-08-21T21:37:11.558951084Z npm ERR! A complete log of this run can be found in:
2022-08-21T21:37:11.558972684Z npm ERR! /root/.npm/_logs/2022-08-21T21_37_11_479Z-debug.log
/home/LogFiles/2022_08_21_lw0sdlwk0001T3_docker.log (https://backendtaap.scm.azurewebsites.net/api/vfs/LogFiles/2022_08_21_lw0sdlwk0001T3_docker.log)
2022-08-21T04:07:01.722Z ERROR - Container backendtaap_0_4714aab5 for site backendtaap has exited, failing site start
Package.json
{
"name": "taap",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"engines": {
"node": ">=16.0.0"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.0.1",
"compression": "^1.7.4",
"config": "^3.3.7",
"cors": "^2.8.5",
"debug": "^4.3.3",
"dotenv": "^16.0.1",
"express": "^4.17.3",
"express-async-errors": "^3.1.1",
"helmet": "^5.0.2",
"joi": "^17.6.0",
"joi-objectid": "^4.0.2",
"joi-password-complexity": "^5.1.0",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.21",
"mongoose": "^6.4.4",
"nodemon": "^2.0.15",
"swagger-jsdoc": "^6.2.1",
"swagger-parser": "^10.0.3",
"swagger-ui-express": "^4.4.0",
"winston": "^3.6.0",
"winston-mongodb": "^5.0.7"
}
}

npm ERR! code ELIFECYCLE npm ERR! errno 126

Firsty I should do npm run build then npm run install, but no matter what to type on the server I am getting this error.
sh: 1: react-app-rewired: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! manager-polling-app-client#0.1.0 start: `react-app-rewired start`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the manager-polling-app-client#0.1.0 start 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! /root/.npm/_logs/2020-01-08T05_17_59_301Z-debug.log
NPM install is running on my local system but fails on server.
I cleaned cache, deleted node_modules and package-lock.json and re-installed them, but it didn`t worked.
My package.json
{
"name": "manager-polling-app-client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^3.9.3",
"ajv": "^6.0.0",
"ajv-keywords": "^3.2.0",
"antd": "^3.16.3",
"arui-feather": "^12.12.0",
"b64-to-blob": "^1.2.19",
"moment": "^2.22.2",
"pdfmake": "^0.1.53",
"prop-types": "^15.7.2",
"react": "^16.11.0",
"react-awesome-modal": "^2.0.5",
"react-data-export": "^0.5.0",
"react-dom": "^16.11.0",
"react-export-excel": "^0.5.3",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.1",
"react-select": "^2.4.2",
"xlsx": "^0.14.4"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"babel-plugin-import": "^1.11.0",
"react-app-rewire-less": "^2.1.3",
"react-app-rewired": "^1.6.2"
}
}
P.S. I found that I can change rights with chmod -R 777, but people say it`s a bad idea. Personally, it worked on the server and I do not wanna play with rights (worry that will crash it at , i think there is another way to solve issue.
P.P.S. If here I should use yarn, then I should yarn add on local system and then permanently use yarn on server?
P.P.P.S. I am really newbee in npm and in yarn... sorry if question seems stupid

AWS - EB - Node - Error: Cannot find module '../'

Bcrypt with its dependency node-pre-gyp causes some serious issue when deployed to Elastic Beanstalk.
bcrypt version: 3.0.6
Nodejs version: 8.16 (also same for v.10)
Amazon Linux 4.8.2
bcrypt#3.0.6 install /tmp/deployment/application/node_modules/bcrypt
node-pre-gyp install --fallback-to-build
module.js:550
throw err;
^
Error: Cannot find module '../'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/tmp/deployment/application/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt#3.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#3.0.6 install 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! /tmp/.npm/_logs/2019-08-11T14_06_34_179Z-debug.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v8.15.1-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2019/08/11 14:06:34 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
And relevant sections of package.json
"dependencies": {
"axios": "^0.19.0",
"bcrypt": "^3.0.6",
"body-parser": "^1.18.3",
"chai": "^4.2.0",
"express": "^4.16.4",
"firebase": "^5.8.6",
"firebase-admin": "~6.0.0",
"jsonwebtoken": "^8.5.0",
"mocha": "^6.0.2",
"shortid": "^2.2.14"
},
"devDependencies": {
"#babel/cli": "^7.2.3",
"#babel/core": "^7.3.4",
"#babel/polyfill": "^7.2.5",
"#babel/preset-env": "^7.3.4",
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},
"private": true
}
When deploying to Elastic Beanstalk running Node 8.x, node-gyp doesn't have sufficient permissions to write to the tmp directory. bcrypt won't install and the application deployment will fail.
A workaround is to add a .npmrc file to the root of your project that will force node-gyp to run as root and allow the installation to complete. File contents for .npmrc:
# Force npm to run node-gyp also as root, preventing permission denied errors in AWS with npm#5 or #6
unsafe-perm=true
pls check this also https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions
Credit goes to this post:
Beanstalk: Node.js deployment - node-gyp fails due to permission denied

Npm start doesn't work in an Angular 2 and Laravel 5 project

I am working on a Laravel 5.2 and Angular 2 project and I've just finished setting up angular but when running npm start, I get the following error :
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! # postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # postinstall script 'typings install'.
npm ERR! This is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
Can you guys help me ?
This is the content of my package.json :
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch",
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"bootstrap-sass": "^3.0.0",
"concurrently": "^1.0.0",
"del": "^2.2.0"
},
"dependencies": {
"angular2": "2.0.0-beta.0",
"bootstrap-sass": "^3.0.0",
"elixir-typescript": "^1.1.2",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"laravel-elixir": "^4.0.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"systemjs": "0.19.6",
"zone.js": "0.5.10"
}
}
Your script is failing while trying to run 'typings install'.
1. Include typings in devDependencies
{
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
}
Run npm install
Create typings.json as below
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160807145350"
}
}
npm start
if you still having issue install typings globally
npm install typings --global
I too face this problem i do the following steps
1. i uninstall nodejs and install the latest version.
2. close the command promt and open.
3. execute npm install
4. execute npm build(not nesessery)
5. execute npm start
This works for me.

npm ERR! version not found: i#0.3.2 error

Please help. I am having a NPM app which when I downloaded locally and trying to do a "npm install" is throwing me the - "npm ERR! version not found: i#0.3.2" error.
C:\Users\xyaz\Desktop\MS\MSWeb\WebContent>npm install
npm WARN package.json msportal#0.0.1-SNAPSHOT No description
npm WARN package.json msportal#0.0.1-SNAPSHOT No repository field.
npm WARN package.json msportal#0.0.1-SNAPSHOT No README data
npm WARN package.json msportal#0.0.1-SNAPSHOT No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! version not found: i#0.3.2
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\xyaz\Desktop\MS\MSWeb\WebContent\npm-debug.log
I tried googling and was able to find this solution
https://github.com/pksunkara/inflect/issues/11
but I am not sure how to apply that solution to my problem.
I mean, I dont see a reference to "i" anywhere in my package.json or I am not able to recognize something that is very obviously present.
Here is my package.json file
{
"author": "QSD",
"name": "msportal",
"homepage": "http://www.cqst.com",
"version": "0.0.1-SNAPSHOT",
"buildversion": "0.1",
"distdirroot": "release",
"distdirextension": "src/content",
"engines": {
"node": ">= 0.8.4"
},
"dependencies": {},
"devDependencies": {
"fs-extra": "^0.16.3",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compress": "~0.9.1",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-connect": "~0.8.0",
"grunt-contrib-copy": "~0.4.0",
"grunt-contrib-cssmin": "~0.4.1",
"grunt-contrib-htmlmin": "~0.2.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-uglify": "~0.5.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-execute": "~0.2.1",
"grunt-html2js": "~0.2.7",
"grunt-include-source": "~0.3.5",
"grunt-text-replace": "~0.3.11",
"http-server": "^0.6.1",
"json-proxy": "~0.1.2",
"livereloadx": "^0.3.2",
"load-grunt-tasks": "^1.0.0",
"time-grunt": "^1.0.0",
"underscore": "~1.6.0",
"webserver": "~1.1.2"
},
"scripts": {
"prestart": "npm install",
"start": "http-server -a localhost -p 8000 -c-1"
}
}
I tried doing "npm install -g npm". But, that doesnt help either.
Any inputs on how to fix this?
i#0.3.2 got unpublished, so anything depending on it will need to be upgraded to use i#0.3.3, which was published almost immediately after 0.3.2 got unpublished.
npm ls i
will show you the path to it (and show you that it's MISSING), as well as what depends on it
Update: After editing the package.json to use
"json-proxy":"*"
you should no longer get this error.
If you're curious the dependency chain looks like this. json-proxy depends on
optimist/ httpp-proxy/utile/i

Resources