How to fix errors in Gridsome.js? - npm-install

Problem Summary
So I'm trying to launch a new Gridsome project for local development. I've toyed with Gridsome in the past and had a great experience, so I decided to give it another shot.
This time around; however, when I run the gridsome create command, the system creates a new Gridsome site directory as expected but returns the following error message:
The instructions in this error message say to enter the newly-created site directory and run gridsome develop to start local development. However, after running cd my-gridsome-site and subsequently running gridsome develop, I then receive this error:
So far, I've tried running npm install --save from the site directory as well as yarn install, both to no avail. Thinking that this was possibly tied to my terminal, I switched from using the Zsh terminal to using the Bash terminal. This also did not work.
I'm at a loss here and could really use a hand.
Thank you for helping,
David

This seems to be an environment error. Gridsome requires Node.js (v8.3+) and recommends Yarn.
Make sure your Node.js version is v8.3+ and use only one package manager like Yarn.
to check node version: node -v

I had this same issue, but I resolved it after installing yarn and running the project with yarn instead of NPM. So you should try using yarn it will help,

Related

Vue CLI: What exactly happens when I use "npm install"?

I've been using the command line for some time now, but I'm still not sure what exactly happens when I do certain things - and I'm not sure what to google for help.
When I'm working with Anaconda and Python, I found the environments I created in C:\Users\<User>\Anaconda3\envs. And every python package I install in an environment seems to go there. Great!
But how does this work outside of Anaconda/Python? For example, I installed the vue CLI via npm install -g #vue/cli. What exactly happens when I do this; or more precicely, where are files saved?
During the creation of a new vue project, a readme.md is created as well. It states that users should simply npm install to setup the project. It seems that this command installs all packages stated in the package.json. I would like to try out if this command works for new users, but I already (obviously) have everything installed. Can I create some kind of environment (like I do with Anaconda for Python) to accomplish this?
Thanks a lot for your answers!

Vue Project not working after ubuntu customization

I have created a project using vue.js at the frontend and flask at the backend, It was working perfectly. But, after I customized my ubuntu OS, suddenly I am unable to run the project, my flask and every other framework and library was uninstalled and I am unable to reinstall vue and I get this error message when I try to install vue again:
Can someone tell me how to resolve this issue?
By Customization, I installed some extensions and then some wallpapers, icon packs etc..
As a user has mentioned in the replies earlier, what you are trying to do is installing a global package, and the error displayed there clearly stated that you lacked permissions, and the customizations you mentioned should not have any impact on this.
Since you are using Ubuntu, just add a sudo in front of the command that you are trying to execute and it should be fixed.

Terminal stuck, cannot enter git commands after npm install

I have cloned a GitHub repo and ran npm install as usual (I have it installed globally)
For some reason when I run start, the terminal gets stuck in build, though it did build with parcel (dist folders are created), also I can see the live server page. I can code, I can update.
The problem is that the terminal is stuck on the error message below and I have to start a new terminal every time.
error message on terminal
Building...(node:14216) ExperimentalWarning: Package name self resolution is an experimental feature. This feature could change at any time
/ Building CSSPlugin.js...(node:8680) ExperimentalWarning: Package name self resolution is an experimental feature. This feature
could change at any time
- Building bundle-url.js...(node:14220) ExperimentalWarning: Package name self resolution is an experimental feature. This feature could change at any time
Any idea why I am getting this and how to get rid of it?
Obs.: I have attempted to delete the folder and clone again, the same issue when running npm start for the first time.
Had the same behaviour on Node.js v13.9.0.
After updating Node.js to latest stable version, the warning message is gone and everything works fine.

Install NPM modules on current project while offline

this question might seem stupid but I'm looking for a solution to this scenario:
Let's say I'm starting a new project at an offline environment and I have some npm packages installed globally on my laptop and I'd like to use them for a new project I just created.
For example: I've used npm i -g create-react-app and now I'd like to use create-react-app to make a new react app but I'm currently offline.
I've tried to follow an "offline npm" solution where I basically create an npm server on my computer but I didn't manage to make it work, and am not sure if this will give me the solution I'm looking for.
Sorry if this was answered before, I couldn't find a solution.
Thanks in advance!
You can try run
create-react-app youproject
when you are offline. For me, this sometimes work, sometimes not.
Other solution is install offline all packages, defined in package.json file. You can do this, if you have this packages installed in online mode.
So you can try install this packages, using:
npm link packagename
or
npm i './path_to_package_in_user_directory' // yes, you can also install packages from folder
This solution is also ok, when you try add new packages to existing project. Sometimes this causes error and you need reinstall all packages (that's big pain), but most of all, works good.

Node.JS, NPM: EJS deleted itself, installs (but doesn't install), and isn't available to Download?

About 10 minutes ago I was following an online tutorial. I shut down the local server to bring my dog inside the house, then came back to the computer to finish the tutorial.
I restarted the server and got this error:
Error: Cannot find module 'ejs'
I looked in my node_modules folder, and I don't see "ejs" anywhere. I thought ok, no biggie, just reinstall. So I typed: npm install ejs -g into the terminal.
The terminal says:
+ ejs#2.6.1
updated 1 package in 0.275s
I looked in the node_modules folder again, and the "ejs" folder is not there. I checked the package.json file, and I don't see ejs listed under dependencies. (Actually, I don't know if it was there before, I can't remember. I think Express was the only Dependency)
I went to the EJS website (http://www.embeddedjs.com/) to see if I could download it directly, and just pop in the file directly onto my computer, but all of the download links return a 404 page.
There is another link at the top of their webpage: Google Code. I'm not sure which files I should download from there. I literally started tinkering with Node.js this morning.
I'm just super confused on why this is happening or how I can fix it.
You installed it globally. You can run npm list -g to see where global libraries are installed. You won't be able to find it in local directory where package.json is located.