0

I use a MacOS High Sierra. For anyone with experience with Nuxt.js, the command npx create-nuxt-app <project-name> has not worked for me at all!

I consistently come across errors from npm saying I need to update my dependencies. I first tried updating each dependency using npm outdated (check for outdated packages) and npm update <pkg name>. This did not work.

I also uninstalled and reinstalled node and npm and tired the above (and below processes). Still did not work.

No matter what I do, the Terminal keeps saying my core-js needed to be updated so I did that (I tried both npm i core-js and npm i core-js ) - they did not work.

To update the npm dependencies, I used the command npm install -g npm-check-updates followed by ncu -u, and then tried both npm update and npm install. Nothing has worked so far.

Lastly, I've tried creating a package.json since npm complained that I had no package.json so I created one using npm init and following the instructions to commit the file(s) created. Still, nothing after running npx create-nuxt-app <project-name>.

What is happening? Has anyone experienced this issue? I really love Nuxt.js and I've tried this for an entire day but I'm giving up on using NuxtJS.

EDIT: I managed to solve part of my problem by creating a Nuxt app from scratch. However, I get the following errors:

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nuxt-app@2.11.0 dev:nuxt npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nuxt-app@2.11.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

MT_dev
  • 163
  • 1
  • 10

2 Answers2

0

There are many solution based on your problem. Sharing a simple one, if you have npm installed then execute below command to install npx:

npm install -g npx

you can find all others solution from here

and My suggestions are:

As i saw your description, package.json not created. definitely something wrong for creation of the project, it may cause the read write problem of files into disk. or you have created the project into subdirectory but trying to run the project from parent directory. initially many peoples doing this practice to create scratch project. by the way create a separate directory and then run npx create-nuxt-app. no need to give project name and pass the phase when prompt to create project in same directory. so then i think problem will solved

Mahamudul Hasan
  • 2,745
  • 2
  • 17
  • 26
  • I do have npx installed. I actually solved part of my problem by creating a Nuxt app from scratch but now when I run `npm run dev`, I get this error: `npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nuxt-app@2.11.0 dev: `nuxt` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nuxt-app@2.11.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.` – MT_dev Feb 13 '20 at 02:36
  • did you run npm install first? – Mahamudul Hasan Feb 13 '20 at 02:38
  • yes, I did everything in the order I saw on Nuxt.js! – MT_dev Feb 13 '20 at 02:40
  • remove your npm modules, and install the packages by executing npm run install. then try again npm run dev – Mahamudul Hasan Feb 13 '20 at 02:41
  • As i saw your description, package.json not created. definitely something wrong for creation of the project, it may cause the read write problem of files into disk. or you have created the project into subdirectory but trying to run the project from parent directory. initially many peoples doing this practice to create scratch project. by the way create a separate directory and then run npx create-nuxt-app. no need to give project name and pass the phase when prompt to create project in same directory. so then i think problem will solved – Mahamudul Hasan Feb 13 '20 at 02:48
  • Yes, thank you! Creating a separate directory and running the create-app command worked the next day (perfectly). For some reason, it didn't go so smooth the day before. – MT_dev Feb 13 '20 at 13:00
  • Thank you, as per discussion i changed the post, – Mahamudul Hasan Feb 13 '20 at 13:03
0

I fixed the issue! It worked when I created a new directory altogether (the next day) and reran npx create-nuxt-app <new-app>. Get started, build for production, and tests ran perfectly.

MT_dev
  • 163
  • 1
  • 10