npm install ember-cli Maximum call stack size exceeded - node.js

I'm facing a similar issue found in this question: Win 8.1, Vagrant, Chef, Ubuntu, Ember-cli, ember new "npm ERR! tar.unpack untar error /home/vagrant/.npm/"
I'm trying to update an older ember project to 2.1 using the new ember-cli.
I'm running my project on a vagrant server.
I have node (v.0.12.7), npm (3.3.10), bower (1.6.5)
and ember-cli -g (version: 1.13.8, node: 0.12.7, npm: 2.13.4, os: linux x64) installed.
Yet, whenever I'm running "npm install --no-bin-links" on the project generated by ember init I get the following error:
51716 error tar.unpack untar error /home/vagrant/.npm/ember-cli/1.13.8/package.tgz
51717 verbose stack RangeError: Maximum call stack size exceeded
51717 verbose stack at Array.filter (native)
51717 verbose stack at /usr/lib/node_modules/npm/lib/install/actions.js:55:37
51717 verbose stack at Array.forEach (native)
51717 verbose stack at markAsFailed (/usr/lib/node_modules/npm/lib/install/actions.js:54:16)
51717 verbose stack at /usr/lib/node_modules/npm/lib/install/actions.js:57:7
51717 verbose stack at Array.forEach (native)
51717 verbose stack at markAsFailed (/usr/lib/node_modules/npm/lib/install/actions.js:54:16)
51717 verbose stack at /usr/lib/node_modules/npm/lib/install/actions.js:57:7
51717 verbose stack at Array.forEach (native)
51717 verbose stack at markAsFailed (/usr/lib/node_modules/npm/lib/install/actions.js:54:16)
51718 verbose cwd /at/Site/public/preview/EP
51719 error Linux 3.2.0-4-amd64
51720 error argv "node" "/usr/bin/npm" "i"
51721 error node v0.12.7
51722 error npm v3.3.10
51723 error Maximum call stack size exceeded
51724 error If you need help, you may report this error at:
51724 error <https://github.com/npm/npm/issues>
51725 verbose exit [ 1, true ]
Is this related to the different version numbers of npm (globally and in ember-cli) or is this something in my vagrant setup? This problem isn't caused by the windows max path length, I've already checked.
EDIT
I've tried to install the npm packages separately instead of with "npm install --no-bin-links". The only one failing is "npm install --no-bin-links ember-cli#1.13.8". These are the dependencies within my package.json:
"broccoli-asset-rev": "^2.1.2",
"ember-cli": "1.13.8",
"ember-cli-app-version": "0.5.0",
"ember-cli-babel": "^5.1.3",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.0.1",
"ember-cli-htmlbars": "0.7.9",
"ember-cli-htmlbars-inline-precompile": "^0.2.0",
"ember-cli-ic-ajax": "0.2.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.0",
"ember-cli-release": "0.2.3",
"ember-cli-sri": "^1.0.3",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.8",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3"
Thank you for your time

I've fixed my problem.
As it turns out, the way My folder was mounted in my vagrant was so slow it interfered with my npm install.
In my vagrant file the folder was mounted like so:
config.vm.synced_folder "../", "/at"
I've replaced it with this:
config.vm.provision "shell", run: "always" do |s|
s.inline = "sudo apt-get update
sudo bash /vagrant/mountfolder.sh"
end
And next to my vagrant file I've placed a file "mountfolder.sh"
# replace your username and password with for example: user, ****. Replace YOURSHARENAME with the name of your windows share
# mountpoint checks if share is already mounted, prevents warning when provisioning
mountpoint -q /projects|| (mkdir /projects -p && apt-get -y install cifs-utils && mount -t cifs //192.168.255.1/YOURSHARENAME /projects --verbose -o 'user=dkdomain.intra\YOURUSERNAME,password=YOURPASSWORD,rw,uid=vagrant,gid=vagrant,file_mode=0777,dir_mode=0777')
Where you replace the capitals with the necessairy info.

Related

npm run serve gives error sh: vue-cli-service: command not found in Vue Cli app

Yesterday I noticed something very odd after cloning my work groups repository. After installing dependencies with npm install, I could not start the devserver (or run any npm scripts) inside the project. Strange. So I then tried to create my own fresh new project with #vue/cli and the same thing happened there.
Environment:
Node: v14.15.0
NPM: v6.14.8
Globally installed Vue Cli: v4.5.8
macOS Catalina: v10.15.7
Package.json in project:
"name": "eezer_app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuetify": "^2.2.11",
"vuex": "^3.4.0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-plugin-router": "~4.5.0",
"#vue/cli-plugin-vuex": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"vue-cli-plugin-vuetify": "~2.0.7",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.3.0"
}
}
Error output:
➜ eezer_app git:(master) ✗ npm run serve
> eezer_app#0.1.0 serve /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
> vue-cli-service serve
sh: vue-cli-service: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! eezer_app#0.1.0 serve: `vue-cli-service serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the eezer_app#0.1.0 serve 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/my-real-name/.npm/_logs/2020-11-03T09_50_50_094Z-debug.log
Debug log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'serve' ]
2 info using npm#6.14.8
3 info using node#v14.15.0
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle eezer_app#0.1.0~preserve: eezer_app#0.1.0
6 info lifecycle eezer_app#0.1.0~serve: eezer_app#0.1.0
7 verbose lifecycle eezer_app#0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle eezer_app#0.1.0~serve: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle eezer_app#0.1.0~serve: CWD: /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
10 silly lifecycle eezer_app#0.1.0~serve: Args: [ '-c', 'vue-cli-service serve' ]
11 info lifecycle eezer_app#0.1.0~serve: Failed to exec serve script
12 verbose stack Error: eezer_app#0.1.0 serve: `vue-cli-service serve`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:315:20)
12 verbose stack at maybeClose (internal/child_process.js:1048:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid eezer_app#0.1.0
14 verbose cwd /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
15 verbose Darwin 19.6.0
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
17 verbose node v14.15.0
18 verbose npm v6.14.8
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error eezer_app#0.1.0 serve: `vue-cli-service serve`
23 error spawn ENOENT
24 error Failed at the eezer_app#0.1.0 serve script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
Same error shows up in a freshly made Vue project created with vue create as well.
It seems that npm is trying to look for dependency packages globally instead of locally in node_modules, since I can run serve by manually selecting the script in local node_module .bin like this:
./node_modules/.bin/vue-cli-service serve
Then it starts perfectly without any fault, so there is no issue with installed node_modules etc. I have tried fixing this since yesterday with no results. I found tips to clear npm cache, delete local node_modules & package-lock.json but it does not work at all. I even re-installed CLT on my Mac.
What happened with my npm? Why does it seem to look for dependencies in my global node_module?
Appreciate any kind of tips since I have exhausted most of my options.
I updated Node, NPM, all my global node modules, ran brew update, reinstalled xcode: sudo rm -rf /Library/Developer/CommandLineTools then xcode-select --install and it seems to be working again.
Same error shows up in a freshly made Vue project created with vue create as well.
created a fresh vue project using #vue/cli and I was able to run npm run serve. Hopefully this helps for anyone else facing this issue.

jhipster yarn start command

when i run yarn start command
the error log generate is:
yosay#^1.0.0, yosay#^1.0.2:
version "1.2.1"
resolved "https://registry.yarnpkg.com/yosay/-/yosay-1.2.1.tgz#9466ef969830e85b474e267b50f7688693ed3b5b"
dependencies:
ansi-regex "^2.0.0"
ansi-styles "^2.0.0"
chalk "^1.0.0"
cli-boxes "^1.0.0"
pad-component "0.0.1"
repeating "^2.0.0"
string-width "^1.0.0"
strip-ansi "^3.0.0"
taketalk "^1.0.0"
wrap-ansi "^2.0.0"
zone.js#0.8.20:
version "0.8.20"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.20.tgz#a218c48db09464b19ff6fc8f0d4bb5b1046e185d"
Trace:
Error: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c yarn run webpack:dev
Directory: D:\JhSocietyAlekha
Output:
at ProcessTermError.MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:186:110)
at new ProcessTermError (C:\Program Files (x86)\Yarn\lib\cli.js:226:113)
at ChildProcess.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:30281:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
What is the version of yarn you are using? You could be affected by: https://github.com/yarnpkg/yarn/issues/5481. Also, I've had many issues using yarn on Windows. I would recommend using npm instead.

Laravel 5.4-Vue npm run watch error

I am trying to execute npm run watch from the Windows Command Line in my Laravel-Vue Project. I am using the following:
Windows 10 Home Edition
Node Version 7.10.0
npm version 5.5.1
Here is my
package.json:
{
"private": true,
"devDependencies": {
"watchify": "^1.0.6",
"bootstrap-sass": "^3.0.0",
"laravel-elixir": "^2.0.0",
"coffee-script": "^1.8.0",
"coffeeify": "^1.1.0",
"gulp": "^3.8.8",
"gulp-clean-css": "*",
"stringify": "^3.1.0",
"vue": "*"
},
"scripts": {
"watch": "watchify -v -t coffeeify -t stringify resources/assets/js/app.js -o public/js/bundle.js",
"build": "browserify -v -t coffeeify -t stringify resources/assets/js/app.js -o public/js/bundle.js"
}
}
Whenever I run the command, I am getting the following error:
> # watch C:\xampp\htdocs\software_vue
> watchify -v -t coffeeify -t stringify resources/assets/js/app.js -o public/js/bundle.js
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.dirname (path.js:695:5)
at Deps.lookupPackage (C:\xampp\htdocs\software_vue\node_modules\module-deps\index.js:452:29)
at Deps._transform (C:\xampp\htdocs\software_vue\node_modules\module-deps\index.js:93:10)
at Deps.Transform._read (C:\xampp\htdocs\software_vue\node_modules\readable-stream\lib\_stream_transform.js:184:10)
at Deps.Transform._write (C:\xampp\htdocs\software_vue\node_modules\readable-stream\lib\_stream_transform.js:172:12)
at Labeled.Pipeline._write (C:\xampp\htdocs\software_vue\node_modules\stream-splicer\index.js:73:22)
at doWrite (C:\xampp\htdocs\software_vue\node_modules\readable-stream\lib\_stream_writable.js:279:12)
at writeOrBuffer (C:\xampp\htdocs\software_vue\node_modules\readable-stream\lib\_stream_writable.js:266:5)
at Labeled.Writable.write (C:\xampp\htdocs\software_vue\node_modules\readable-stream\lib\_stream_writable.js:211:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `watchify -v -t coffeeify -t stringify resources/assets/js/app.js -o public/js/bundle.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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! C:\Users\Debarun Pal\AppData\Roaming\npm-cache\_logs\2017-10-09T10_17_15_209Z-debug.log
Debug Log Dump
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'cache',
1 verbose cli 'clean' ]
2 info using npm#5.5.1
3 info using node#v7.10.0
4 verbose npm-session 1bde4f10d2ea77e8
5 verbose stack Error: As of npm#5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
5 verbose stack
5 verbose stack If you're sure you want to delete the entire cache, rerun this command with --force.
5 verbose stack at clean (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:70:22)
5 verbose stack at EventEmitter.cache (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:45:16)
5 verbose stack at Object.commandCache.(anonymous function) (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:149:13)
5 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:84:30)
5 verbose stack at _combinedTickCallback (internal/process/next_tick.js:73:7)
5 verbose stack at process._tickCallback (internal/process/next_tick.js:104:9)
6 verbose cwd C:\xampp\htdocs\software_vue
7 verbose Windows_NT 10.0.15063
8 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "cache" "clean"
9 verbose node v7.10.0
10 verbose npm v5.5.1
11 error As of npm#5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
11 error
11 error If you're sure you want to delete the entire cache, rerun this command with --force.
12 verbose exit [ 1, true ]
I am unable to trace back to the issue and kind of lost, rather, where to start debugging.

react-scripts: not found on create-react-app project on ubuntu?

I am working on reactjs using this one
https://github.com/facebookincubator/create-react-app
But when i deploy it to digitalocean on top of ubuntu 16
I can not run npm run build and got this as an error.
deploy#xxxx:/www/tmdb_admin$ sudo npm run build
[sudo] password for deploy:
> tmdb_admin#0.1.0 build /www/tmdb_admin
> react-scripts build
sh: 1: react-scripts: not found
npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v7.3.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! tmdb_admin#0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the tmdb_admin#0.1.0 build script 'react-scripts build'.
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 tmdb_admin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs tmdb_admin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls tmdb_admin
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /www/tmdb_admin/npm-debug.log
So this is my package.json file.
{
"name": "tmdb_admin",
"version": "0.1.0",
"private": true,
"devDependencies": {
"autoprefixer-stylus": "0.10.0",
"concurrently": "3.0.0",
"react-scripts": "0.6.1",
"stylus": "0.54.5"
},
"dependencies": {
"bulma": "^0.2.3",
"case-sensitive-paths-webpack-plugin": "^1.1.4",
"es6-promise": "^4.0.5",
"font-awesome": "^4.7.0",
"isomorphic-fetch": "^2.2.1",
"jwt-simple": "^0.5.0",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-pagify": "^2.1.1",
"react-redux": "^4.4.5",
"react-router": "^2.4.0",
"react-router-redux": "^4.0.4",
"react-slick": "^0.14.5",
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
"segmentize": "^0.4.1",
"slick-carousel": "^1.6.0"
},
"scripts": {
"start": "react-scripts start",
"watch": "concurrently --names 'webpack, stylus' --prefix name 'npm run start' 'npm run styles:watch'",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"styles": "stylus -u autoprefixer-stylus ./src/css/style.styl -o ./src/css/style.css",
"styles:watch": "stylus -u autoprefixer-stylus -w ./src/css/style.styl -o ./src/css/style.css"
}
}
And this is my node and npm version.
deploy#xxxx:~$ node -v
v7.3.0
deploy#xxxx:~$ npm -v
4.0.5
How can i fix this and make npm run build works?
Thanks!
I had the same problem today and I fixed it running install again.
All that you need to do is rum again the command npm install into your project so you'll be able to run npm start comand again!
Works for me!
I hope I've Helped!
When you copy a generated create-react-app project to another directory (i.e. when it was deployed to the server), it failed because symlinks were not preserved. See https://github.com/facebookincubator/create-react-app/issues/200. The file react-scripts in ./node_modules/.bin/ needs to be symlinked to ./node_modules/react-scripts/bin/react-scripts.js. Using diff will not show the differences since the symlinks will be resolved.
Easiest solution is to create a temporary react project on the server (i.e. on the Digitalocean) and then copy the content of the ./node_modules/.bin using copy -a (and not copy -r, in order to preserve symlinks).
$ create-react-app tempReact
$ cp -a tempReact/node_modules/.bin/* myActualReactApp/node_modules/.bin
Another solution is to manually re-create the symlinks.
$ ln -s myActualreactApp/node_modules/react-scripts/bin/react-scripts.js myActualReactApp/node_modules/.bin/react-scripts
Run:
sudo chown -R $USER:$USER '/home/ubuntu/.npm/'
On Linux OS NPM and NodeJS are installed globally with sudo and the owner of that files is the root and usually a user can only read/execute that packages. When NPM is stalled a ~/.npm/ folder is created by the root. By running create-react-app you are executing the command as user and create-react-app is trying to modify something in the ~/.npm/ directory which is owned by the root and not to current user. You need to change the owner of that directory to you, so you can modify it without sudo privileges.
Often similar thing happens when you install NPM package with sudo e.g. sudo npm install --save. Again the newly installed package in owned by the root and for example when you try to update/modufy/delete your project without sudo infrnt of NPM you will have similar permission error. In these cases navigate to your project directory and change its owner by running:
sudo chown -R $USER:$USER
Source: create-react-app fails with permission denied

Encountering problems while executing : npm install exec-sync

Version info :
node#4.6.0
node-gyp#3.4.0
npm#2.15.9
I try to install the following dependencies :
"canvas": "^1.1.6",
"exec-sync": "^0.1.6",
"fabric": "^1.6.0",
"request": "^2.67.0",
"word": "^0.2.4"
So i do an npm install the following dependencies are installed:
"canvas": "^1.1.6",
"fabric": "^1.6.0",
"request": "^2.67.0",
"word": "^0.2.4"
But the exec-sync delivers the following error:
1443 verbose stack Error: ffi#1.2.5 install: `node-gyp rebuild`
1443 verbose stack Exit status 1
1443 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
1443 verbose stack at emitTwo (events.js:87:13)
1443 verbose stack at EventEmitter.emit (events.js:172:7)
1443 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
1443 verbose stack at emitTwo (events.js:87:13)
1443 verbose stack at ChildProcess.emit (events.js:172:7)
1443 verbose stack at maybeClose (internal/child_process.js:829:16)
1443 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Im a litte bit lost at this point, i tried the following things:
Deleted all the node_modules and tried an fresh install;
Tried installing the modules seperately;
Is it a version problem of node.js vs the exec-sync build?, im lost.
I fixed it!
CD to node_modules
git clone https://github.com/jeremyfa/node-exec-sync edit
open node-exec-sync/package.json to remove the ffi dependency line
npm install ./node-exec-sync
Here are the steps I followed as a workaround to npm install for testing:
removed exec-sync dependency from package.json
npm install ffi (installs latest version ok)
git clone https://github.com/jeremyfa/node-exec-sync
edit node-exec-sync/package.json to remove the ffi dependency line
npm install ./node-exec-sync then npm install finished ok
Don't use node-exec-sync, it's very difficult to install, on every OS that I've tried, for different reasons.
Instead, use https://www.npmjs.com/package/cross-spawn , which doesn't have any of these unbuildable native dependencies. It's basically an all-around better replacement for node-exec-sync or the built-in child_process APIs.

Resources