npm doesn't run correctly for react js - json

when I want to run my project on react this error appears...how to solve it?
W:\Burgerapp>npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path W:\Burgerapp\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'W:\Burgerapp\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Polymer\AppData\Roaming\npm-cache\_logs\2020-08-11T13_03_57_137Z-debug.log ```

It seems that you are writing "npm start" in the wrong place because there is no "package.json" file in the directory.

Related

NPM Start on Visual studio

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Windows\System32\WindowsPowerShell\v1.0/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Windows\System32\WindowsPowerShell\v1.0\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Local\npm-cache_logs\2022-10-28T07_57_26_056Z-debug-0.log
how this error removes

I am trying to deploy my MERN stack application on Heroku but I am getting following error

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /tmp/build_adf85737_/client/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_adf85737_/client/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.B4J9l/_logs/2021-01-29T15_45_48_832Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 254
npm ERR! server#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
npm ERR! Exit status 254
npm ERR!
npm ERR! Failed at the server#1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.B4J9l/_logs/2021-01-29T15_45_48_856Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed

When uboxing truffle react, there is no package.json file. As a result, I cannot start the program

I followed the instruction from truffle's site to unbox reacthttps://github.com/truffle-box/react-box
However, when I type in 'npm run start', I get the error
npm ERR! path D:\COMP495\testReact\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\COMP495\testReact\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\l_zha\AppData\Roaming\npm-cache\_logs\2018-11-21T12_45_14_733Z-debug.log
I may note, there is no 'package.json' file in my root directory for whatever reason. There is a 'package.json' file in my client folder, so I can run React, though unsuccessfully.
Figured it out. I needed to run it from the Client directory. From there, in /Client/src/ I need to add the contracts folder from /build/contracts/, NOT /contracts/ from the root directory as there is no json file there.

Trying to run Gulp on Mac but it's not working

I'm trying to run Gulp on my Mac. I went into terminal and cd'd into my gulp folder. When I type
gulp
I get "-bash: gulp: command not found". In my gulp folder I do have a gulpfile.js in there but again I get nothing. Where do I go from here?
Here's the errors I get when I npm install -g:
MacBook-Pro-2:gulp-dev damien$ npm install -g gulp
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! path ../lib/node_modules/gulp/bin/gulp.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/gulp/bin/gulp.js',
npm ERR! dest: '/usr/local/bin/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/damien/.npm/_logs/2017-04-11T20_42_46_317Z-debug.log
MacBook-Pro-2:gulp-dev damien$ npm install -g gulp
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! path ../lib/node_modules/gulp/bin/gulp.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/gulp/bin/gulp.js',
npm ERR! dest: '/usr/local/bin/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/damien/.npm/_logs/2017-04-11T20_43_48_551Z-debug.log
Have you installed Gulp on your machine yet?
If your folder has a package.json file, make sure you can see Gulp in there listed between your devDependencies. These dependencies are what you use during development of your Node project.
If you don't have a package.json file, you can create one in the command line via npm init, then install Gulp locally on your machine with npm install -g gulp, and then install the command line interface for gulp in your project folder: npm install --save-dev gulp-cli. The CLI will run the Gulp executable with the Gulpfile.js that's in your project.
More information can be found on their website: http://gulpjs.com/

NPM delivered package.json throws error

I have created an NPM package and installed it to test it. NPM/Node throws an ENOENT error when installing dependencies for GruntJS in a nested node_modules folder with npm install.
I take these steps to create the error:
npm install pavilion
cd node_modules/pavilion
npm install
When installing the dependencies for Grunt, listed in the package.json...it throws the error as seen below.
PS. please continue reading below.
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm v3.8.6
npm ERR! path /Users/Baasdesign/Desktop/test/node_modules/pavilion/node_modules/.staging/pavilion-8a19d0be
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/Baasdesign/Desktop/test/node_modules/pavilion/node_modules/.staging/pavilion-8a19d0be' -> '/Users/Baasdesign/Desktop/test/node_modules/pavilion'
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/Baasdesign/Desktop/test/node_modules/pavilion/node_modules/.staging/pavilion-8a19d0be' -> '/Users/Baasdesign/Desktop/test/node_modules/pavilion'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm v3.8.6
npm ERR! path npm-debug.log.575049388
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'npm-debug.log.575049388'
npm ERR! enoent ENOENT: no such file or directory, open 'npm-debug.log.575049388'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Baasdesign/Desktop/test/node_modules/pavilion/npm-debug.log
Now the weird part. When I use Bower to install the package...I don't get the error. Here are my steps:
bower install pavilion
cd bower_components/pavilion
npm install
Everything installs fine. The difference? ---> the package.json.
The bower install package.json works find. NPM's doesn't.
Bower gives me a clean package.json, as created by myself before publishing to npm.
NPM install gives me an package.json that had a lot more info in there. When I use the bower package.json...everything install fine...even when I paste and replace the npm package.json in the node_modules folder.
What's the deal here? It seems that the package.json delivered with the npm install messes up the dependency installation.
Here is the bower package.json delivery:
http://pastebin.com/g8FgSDNG
And here is the npm package.json delivery:
http://pastebin.com/xTiQ15ih
I have tried npm cache clean but it didn't work.
sysinfo:
OSX Yosemite
node - 5.10.1
npm - 3.8.6
Node is brilliant but can be a pain sometimes!
I have had this error myself lately and for me rolling back to an earlier version of node fixed my problem.
I would recommend you try out an earlier install you could use "node version manager" to have a few node versions on your system and it provides methods to switch between versions.
I know its not a very technical answer and i hope someone has a specific answer to your question!
[https://github.com/creationix/nvm]
Here's the version manager link hope it helps
The problem was that I didn't save the dependency in the package.json.
I guess Node gets the paths wrong if you do that.
So the correct workflow is:
npm init (create the package.json)
npm install <package> --save-dev
cd node_modules/pavilion
npm install
Then it works fine. The <package> needs to be added to the parent directory's package.json.