Npm Warn Enoent Enoent: No Such File or Directory, Open 'C:\Users\Nuwanst\Package.Json'

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

Have you created a package.json file? Maybe run this command first again.

C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm init

It creates a package.json file in your folder.

Then run,

C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.io --save

The --save ensures your module is saved as a dependency in your package.json file.

Let me know if this works.

ENOENT: no such file or directory, open 'C:\Users\username\package.json' when need to run docker and nodejs

I guess:

FROM node:14.16.1
ENV NODE_ENV=production
WORKDIR /
COPY package.json .
COPY package-lock.json* .
RUN npm cache clean --force
RUN npm install
COPY . .
EXPOSE 3000
CMD npm run start

Solving the 'npm WARN saveError ENOENT: no such file or directory, open '/Users/<username>/package.json'' error

You can't name your project equal the package name that you are trying to install.

Rename your project at the package json and try again or try npm init again and use another name.

ENOENT: no such file or directory, open 'C:\Users\subwo\package.json'

Looks like your package.json is in C:\Users\subwo\ethswap.

cd ethswap
npm run start

To eleborate. You're running npm run start from C:\Users\subwo, but your project directory is really in C:\Users\subwo\ethswap. So you need go one more directory down before running.

ENOENT: no such file or directory, open 'G:\Aframara Website\images

I found a way around it, I Installed npm i -g purgecss

Then I created a folder with the title 'purged' at the root of my website.

I ran this command

purgecss --css *.css **/*.css --content *.html *.js --output purged

What this command did it created the two files i.e style.css and bootstrap.min.css in the folder purged.

Then I changed the css styles URL from css/bootstrap.min.css to purged/bootstrap.min.css and css/style.css to purged/style.css

The *.js is to check to see if you have any styles dynamically generated in javascript. You can leave it if you want.

The size of my two files bootstrap.min.css and style.css were reduced significantly.



Related Topics



Leave a reply



Submit