Error on jhipster:upgrade - npm

When I try to upgrade version of jhipster in my application I get following error:
lothrimond#lothrimond-K53SD:~/workspace/NScanner$ npm list generator-jhipster
n-scanner#0.0.0 /home/lothrimond/workspace/NScanner
└── generator-jhipster#3.6.1
lothrimond#lothrimond-K53SD:~/workspace/NScanner$ yo jhipster:upgrade
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
Looking for latest generator-jhipster version...
/home/lothrimond/workspace/NScanner/node_modules/semver/semver.js:279
throw new TypeError('Invalid Version: ' + version);
^
TypeError: Invalid Version: undefined
at new SemVer (/home/lothrimond/workspace/NScanner/node_modules/semver/semver.js:279:11)
at compare (/home/lothrimond/workspace/NScanner/node_modules/semver/semver.js:566:10)
at Function.lt (/home/lothrimond/workspace/NScanner/node_modules/semver/semver.js:600:10)
at null.<anonymous> (/home/lothrimond/workspace/NScanner/node_modules/generator-jhipster/generators/upgrade/index.js:93:28)
at /home/lothrimond/workspace/NScanner/node_modules/shelljs/src/exec.js:172:7
at ChildProcess.exithandler (child_process.js:194:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
What am I doing wrong? Please write down in comment if any useful information is missing in my question.

yo:jhipster:upgrade is working only for 3.4.0+
Source: jhipster support chat

I did a "npm update -g generator-hipster" which worked. I too was on 3.6.1 prior to the upgrade when the error that you mentioned occurred.
https://jhipster.github.io/2016/09/16/jhipster-release-3.7.1.html refers to this step as manual upgrade.

Related

Expo SDK 44 upgrade error - "expo-cli upgrade"

I want to upgrade expo to the latest version - SDK 47 from SDK 44 that I am currently using.
My npm version is 8.19.2, node version is 16.18.2 if it helps.
When I tried running the command: expo-cli upgrade, I am getting the following error:
✖ Failed to install expo package with error: npm exited with non-zero code: 1
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/spawn-async/src/spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:166:31)
at NpmPackageManager.installAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:82:16)
at NpmPackageManager.addWithParametersAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:96:18)
at NpmPackageManager.addAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/node_modules/#expo/package-manager/src/NodePackageManagers.ts:109:5)
at upgradeAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:496:7)
at actionAsync (/Users/abcd/.nvm/versions/node/v16.18.0/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:42:3)
After reading a bit on the internet, I tried deleting the "package.lock.json" file but I have no idea why it would have worked as it didn't.
I also checked "babel-preset-expo", which is set to 9.0.2 as it should be as per another article.
It will be great if anyone here could help me with this issue. Thanks!
I had the same issue with node v16.4.0 while upgrading from SDK 44. Changing to v14.17.6 or v19.1.0 made the "expo upgrade" command work properly. These are examples, I am sure it works with other versions, just test by yourself.
You can find node versions on this link : https://nodejs.org/dist/index.json
If you do not want to change your node version for some reason, I do not have a solution for it then. I am currently in this case and searching for a solution ...

Nuxt App Output Error when trying to Create

I want to initialize a Nuxt Project using the command
yarn create nuxt-app <project-name>
i get this error:
C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108
throw new SAOError(`Failed to install ${packageName} in ${cwd}`)
^
SAOError: Failed to install packages in C:\Users\AbdulAzeez\Desktop\vue-sax-demo
at ChildProcess.<anonymous> (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108:15)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
__sao: true
}
error Command failed.
Exit code: 1
Command: C:\Users\AbdulAzeez\AppData\Roaming\npm\bin\create-nuxt-app
Arguments: vue-sax-demo
Directory: C:\Users\AbdulAzeez\Desktop
Output:
This is not the first time, i'm creating a nuxt-project, I'm just getting this Error recently!
I even tried using npx, the same Error
Try to use the LTS version of node.js, the v14 is not stable. The current LTS version is 12.17.0 or see this link for the official LTS version if you are seen this in the future ( https://nodejs.org/en/download/)
after that run >>>
npx create-nuxt-app <project-name>

Upgrading jhipster from v5.0.1 to the latest

I am running linux 18.04, installed java 8. I am struggling with upgrading the current version of jhipster (v5.0.1)to the latest. I have used, yo, yarn and npm but there is no success.
With npm I get an error below, with yo i get the [subsequent] error:
Using JHipster version installed globally Executing jhipster:upgradeOptions:
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
events.js:174
throw er; // Unhandled 'error' event
^
Error: ERROR! Current directory does not contain a JHipster project.
at Environment.error (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
at module.exports.error (/usr/lib/node_modules/generator-jhipster/generators/generator-base.js:1981:18)
at module.exports.assertJHipsterProject (/usr/lib/node_modules/generator-jhipster/generators/upgrade/index.js:144:26)
at Object.<anonymous> (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:399:25)
at /usr/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /usr/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:400:11)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
Emitted 'error' event at:
at Immediate.setImmediate (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:406:18)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
[subsequent]
? Generators to update (Press <space> to select, <a> to toggle all, <i> to invert selection)generator-jhipster
Unhandled rejection Error: EACCES: permission denied, open '/home/lelo/.npm/_cacache/index-v5/ad/54/831265f841b3fd278d23c4c96b06a32656a62c88fddaa7739f419602a04d'
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! /home/lelo/.npm/_logs/2019-08-25T22_22_40_369Z-debug.log```
Despite any user type, I am not getting the expected output which is the upgraded version of jhipster. What could I be doing wrong?
Make sure you are in your application directory and have git installed.
Then execute jhipster upgrade.
You will probably have to solve some problems of the resulting merge arising during the update.
More info: https://www.jhipster.tech/upgrading-an-application/

"Already up-to-date" and "Run 'yarn' to install missing dependencies"?

I've got a bit of a weird situation where "ember s" reports "Missing yarn packages" followed by a list of missing packages (two of them) and then "Run 'yarn' to install missing dependencies".
However when I run 'yarn' I get the message "success Already up-to-date" .
Any ideas how to get out of this circle ?
There's something I did immediately before this started which I guess is the source of my problem
Getting rid of an Add-on
I had installed an Ember Add-on which had generated problems so I decided to get rid of it . To do that I did the following :
git push -f origin 913c2dee12b0363df0664c9c63e0443abe0adb57:foo-bar
git reset --hard 913c2dee12b0363df0664c9c63e0443abe0adb57
yarn
yarn install
yarn clean
yarn install
yarn
Where 913c2dee12b0363df0664c9c63e0443abe0adb57 was the last commit before the unwanted add-on was installed. I don't think there was anything wrong in doing that but now I'm wondering.
Output of running Ember Server
When I run 'ember s' I get this output ...
DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli-babel 6.6. Version 5.2.8 located: foobar -> ember-cli-build-date -> ember-cli-babel
Missing yarn packages:
Package: #bower_components/jquery
* Specified: jquery/jquery-dist#
* Installed: (not installed)
Package: #bower_components/jstree
* Specified: vakata/jstree#^3.3.5
* Installed: (not installed)
Run `yarn` to install missing dependencies.
Stack Trace and Error Report: /tmp/error.dump.33c6e8c0abc9fc8abd355dc080268f9c.log
An error occurred in the constructor for ember-cli-dependency-checker at /media/mint/dev/foobar/node_modules/ember-cli-dependency-checker
Warning about ember-cli versions
I don't think this is relevant but just for completeness
Running the 'yarn' results in the following appearing in the output text ...
warning foobar#0.0.0: "dependencies" has dependency "ember-cli" with range "~3.8.1" that collides with a dependency in "devDependencies" of the same name with version "3.8"
EDIT: OK I was able to resolve this with the help of the comment by dwenzel ...
rm -rf node_modules && yarn
Although that actually led into a different issue which I'm almost certain was unrelated but I'll just mention it here in case it's useful to those who come after.
The execution of yarn initially failed with the following error ...
35238 verbose stack Error: node-sass#4.5.3 postinstall: `node scripts/build.js`
35238 verbose stack Exit status 1
35238 verbose stack at EventEmitter.<anonymous> (/home/rshea/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
35238 verbose stack at EventEmitter.emit (events.js:189:13)
35238 verbose stack at ChildProcess.<anonymous> (/home/rshea/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
35238 verbose stack at ChildProcess.emit (events.js:189:13)
35238 verbose stack at maybeClose (internal/child_process.js:970:16)
35238 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
35239 verbose pkgid node-sass#4.5.3
35240 verbose cwd /media/mintextra/dev/ddn-build-test-temp/foobar
35241 verbose Linux 3.13.0-169-generic
35242 verbose argv "/home/rshea/.nvm/versions/node/v10.15.3/bin/node" "/home/rshea/.nvm/versions/node/v10.15.3/bin/npm" "install"
35243 verbose node v10.15.3
35244 verbose npm v6.4.1
35245 error code ELIFECYCLE
35246 error errno 1
35247 error node-sass#4.5.3 postinstall: `node scripts/build.js`
35247 error Exit status 1
35248 error Failed at the node-sass#4.5.3 postinstall script.
35248 error This is probably not a problem with npm. There is likely additional logging output above.
35249 verbose exit [ 1, true ]
I was able to resolve that with ...
npm install node-sass#latest
npm install
... at which point ember s was able to run without errors.
It looks like you want to do yarn install --check-files to verify that the files have not been removed from node_modules. This avoids having to wipe out your node_modules file which can be time consuming.
https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-check-files
https://github.com/yarnpkg/yarn/issues/2240
When yarn gets confused like this, you can usually fix things up by clearing out your node modules before installing:
rm -rf node_modules && yarn
The way I managed to get around this without deleting the entire node_modules directory was just to remove the module from topLevelPatterns within node_modules/.yarn-integrity.
Disclaimer: I don't know what the implications of this are but yarn's integrity was already questionable and it works so meh!?
You may also try to reinstall/download all packages with:
yarn install --force

Anything related to Zurb Foundation in Node JS throws the same error

I am trying to access the template from this repository: https://github.com/zurb/foundation-sites-template
I successfully cloned the repository, but apparently, in order to get the actual sass, I need to install npm dependencies. So I ran npm install, only to get this error:
events.js:160░░░░░░⸩ ⠼ extract:interpret: sill extract interpret#1.0.4
throw er; // Unhandled 'error' event
^
Error: write after end
at writeAfterEnd (_stream_writable.js:193:12)
at PassThrough.Writable.write (_stream_writable.js:240:5)
at PassThrough.Writable.end (_stream_writable.js:477:10)
at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41)
at emitOne (events.js:101:20)
at ReadEntry.emit (events.js:188:7)
at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:296:25)
at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:249:12)
at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:162:27)
at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)
at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)
at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30)
at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)
at emitOne (events.js:96:13)
at Unzip.emit (events.js:188:7)
at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:296:25)
I am using npm version 6.0.0 and node v6.11.2. Running on a mac.
After this I tried installing the foundation cli with npm install foundation-cli --global, but got the exact same error. As far as I know, I meet all the requirements as listed on the github repository, not sure what could be the problem.
Well, turns out it was either my npm or node version. I updated both to the most recent (npm 6.4.1, node v10.8.0) versions, and npm install ran fine. I suppose what can be learned here is that when dealing with zurb foundation, just try to use the latest software.