Nuxt App Output Error when trying to Create - vue.js

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>

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 ...

Running npx create-expo-module results in "Error: npm exited with non-zero code: 1"

I'm trying to create my own Expo module following the instructions in the Expo documentation.
When I run the command npx create-expo-module and I fill out the information that it asks me for (name of npm package, module name, GitHub profile, etc.), it manages to do the first two steps of the module creation:
✔ Downloaded module template from npm
✔ Created the module from template files
But then it gives me this error in the 3rd step:
✖ Installing module dependencies
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at spawnAsync (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\#expo\spawn-async\build\spawnAsync.js:7:23)
at installDependencies (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
at C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:49:56
at newStep (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)
at Command.main (C:\Users\super\AppData\Local\npm-cache\_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:48:31) {
pid: 23924,
output: [ '', '' ],
stdout: '',
stderr: '',
status: 1,
signal: null
}
I'm able to create new Expo projects with expo init without an issue and run them with expo start, so I don't know what the issue could be. My version of the Expo CLI is 6.0.6 and npm is 8.19.2.

Getting error when installing Bugsnag 'Error: spawn npm ENOENT'

this is the first time I post here so apologies if I don't follow some rules or incorrect formatting.
I'm making an app using React Native and Expo and when I try to install bugsnag I get this error.
$ npx bugsnag-expo-cli init
√ #bugsnag/expo does not appear to be installed, do you want to install it? ... yes
√ If you want the latest version of #bugsnag/expo hit enter, otherwise type the version you want ... latest
√ Using yarn or npm? » npm
> Installing #bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Are you attempting to run the bugsnag-expo-cli on Windows? The Expo CLI currently only supports MacOS and Linux:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you can follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

"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

Error on jhipster:upgrade

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.