Error when create jhipster sample 21-points application - node.js

Follow the official guide I installed nodejs, yoman, bower, gulp and generator-jhipster in my mac. After executed "yo jhipster" command it shows something error occured. Where is wrong? I can run "./mvnw" and startup server but the home page hints me there is something error.
npm install -g yo
npm install -g bower
npm install -g gulp
npm install -g generator-jhipster
yo jhipster
...
bootstrap#3.3.7 src/main/webapp/bower_components/bootstrap
โ””โ”€โ”€ jquery#3.1.0
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn gulp ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

it should be npm install -g gulp-cli
See the doc:
Install Gulp: npm install -g gulp-cli (If you have previously
installed a version of gulp globally, please run npm rm -g gulp to
make sure your old version doesnโ€™t collide with gulp-cli)
Also take care of using an LTS version of NodeJS.

Related

Why npm start is getting error for react project?

I'm trying to start a React application, with npm but I get this error:
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
I'm using node version 10.16.3 and npm 6.13.6. I've cleaned npm cache and install npm again, but I'm getting always the same error
I suggest doing these three steps:
npm install -g npm#latest to update npm because it is sometimes buggy.
rm -rf node_modules to remove the existing modules.
npm install to re-install the project dependencies.
the problem is fixed , i've installed another version of "react-scripts" , because the actuel version is not stable , so i use to overwrite it with the given version, so use this command to install :
npm install react-scripts#2.1.8
Once the installation is completed your can run your reac app :
npm start

Install expo cli errors at the end of install

So I'm following this tutorial to try and learn React Native: https://www.youtube.com/watch?v=qSRrxpdMpVc
And in the tutorial he shows to install expo cli using the line
'npm install expo-cli --global'
But when i run that line, i get a whole bunch of warnings saying for example:
npm WARN deprecated topo#3.0.3: This module has moved and is now available at #hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
In the tutorial he says to ignore this but at the end of the install i get this error:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! envsub#3.1.0 postinstall: `test -d .git && cp gitHookPrePush.sh .git/hooks/pre-push || true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the envsub#3.1.0 postinstall 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\Alex\AppData\Roaming\npm-cache\_logs\2019-12-06T01_25_52_024Z-debug.log
and then when i try to run the line 'expo init first-app' to create a project i get this error:
Error: Cannot find module 'C:\Users\Alex\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js'
[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:690:27)[39m
[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)[39m
[90m at internal/main/run_main_module.js:17:11[39m {
code: [32m'MODULE_NOT_FOUND'[39m,
requireStack: []
}
I also found a similar question with an answer of try running
npm cache clean --force
npm install -g expo-cli
So i tried that but it didnt work.
Does anyone know why i would be getting these errors? I tried reinstalling node but that doesnt seem to fix it. Thanks for the help in advance, keep in mind i am completely new to react native
Assuming that you have Node 10 LTS or greater installed, you can use npm to install the Expo CLI command line utility:
npm install -g expo-cli
expo init AwesomeProject
cd AwesomeProject
npm start # you can also use: expo start

Can't install any Node packages globally Ubuntu Digital Ocean

Tried everything. Tried all the steps below, didn't work so I nuked my droplet and rebuilt to start over and try again. I'm Using Ubuntu. First thing once I ssh into my droplet was install node and npm via:
https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Then
npm -v
5.6.0
node -v
v8.11.3
Then I try to install a package globally. I tried electron and it failed so I began messing with the node modules folder as I was getting the permission error with the fix documented here:
https://askubuntu.com/questions/869168/node-modules-have-755-permissions-what-permissions-should-i-set-so-that-npm-don
No luck. So I tried the solution documented here:
NPM global install "cannot find module"
echo $NODE_PATH
/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/username/.npm-global/lib/node_modules
So that didn't work either. This is the error now when I try and install any package globally:
npm install -g electron
I get:
Error: Cannot find module '/root/.npm-global/lib/node_modules/nightmare/node_modules/electron/install.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#1.8.7 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.8.7 postinstall 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/2018-08-03T03_26_03_827Z-debug.log
This error for any package I try to install. Not sure what else to try. Don't want to wipe out the droplet and start over...
I also had this issue but after adding sudo at start the issue went away.
like:
sudo npm -g install nodemon

Windows-build-tools installation failed

Windows 10, Node - 8.8.1, NPM - 5.4.2, Node-gyp - 3.6.2
I try to install gemini using: npm install -g gemini
After searching about this issues i was trying to resolve 1 option for Windows in https://github.com/nodejs/node-gyp#on-windows.
And in this flow i have trouble with windows-build-tools installation.
I run in cmd.exe (like Admin) : npm install --global --production windows-build-tools
Console:
C:\Windows\system32>npm install --global --production windows-build-tools
> windows-build-tools#1.3.2 postinstall C:\Users\p.stepanov\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js
Downloading BuildTools_Full.exe
Downloading python-2.7.13.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.13.msi. Saved to C:\Users\p.stepanov\.windows-build-tools\python-2.7.13.msi.
Starting installation...
events.js:182
throw er; // Unhandled 'error' event
^
Error: spawn powershell.exe ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
at onErrorNT (internal/child_process.js:374:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools#1.3.2 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools#1.3.2 postinstall 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\p.stepanov\AppData\Roaming\npm-cache\_logs\2017-10-31T07_47_09_032Z-debug.log
Already i:
add the environment variable VCTargetsPath top point at the C++
build tools path
try 2 option from https://github.com/nodejs/node-gyp#on-windows
Can anybody help me?
I found problem resolving in https://github.com/felixrieseberg/windows-build-tools/issues/20 :
Just add
%SystemRoot%/system32/WindowsPowerShell/v1.0
to your PATH and you should be good to go
Simply running npm install --global --production windows-build-tools#4.0.0 was not enough for my case. So I'd like to share the solution with the community:
Install Chocolatey if it is not installed on your machine yet (choco -v to check)
Go to Windows PowerShell (with Administrator rights)
Execute choco install python visualcpp-build-tools -y and then npm config set msvs_version 2017
Run npm install --global --production windows-build-tools#4.0.0
Now you are good to go, run npm i to install dependencies ๐Ÿ˜Ž
Use the below command and it should work:
npm install --global --production windows-build-tools#4.0.0
Please make sure your running cmd with admin privileges
npm install --global --production windows-build-tools#4.0.0

react native windows, spawn npm ENOENT error

I am trying to run react-native on windows and get the following error:
C:\Program Files>react-native init AwesomeProject
This will walk you through creating a new React Native project in
C:\Program Fil es\AwesomeProject Installing react-native package from
npm... events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at exports._errnoException (util.js:860:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:450:9)
at process._tickCallback (node.js:364:17)
at Function.Module.runMain (module.js:459:11)
at startup (node.js:136:18)
at node.js:972:3
How do I fix this?
This should be fixed in React Native CLI 0.1.9. To update your CLI:
npm uninstall -g react-native-cli
npm install -g react-native-cli
There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169
Check if the gradlew.bat file is present in the android folder if it is not there then simply copy gradlew.bat file from another project.
react-native-cli#0.1.8 error
Rollback react-native-cli#0.1.7
everything is ok.
To fix this, Reinstall NodeJS https://nodejs.org/en/
Then
npm install -g react-native-cli --vebrose
react-native init App --verbose
If it still fails, try installing Python 3 https://www.python.org/ and repeat the process.

Resources