Содержание
- «ENOENT: no such file or directory» and others during npm install #18403
- Comments
- I’m opening this issue because:
- What’s going wrong?
- How can the CLI team reproduce the problem?
- supporting information:
- How to Solve Error Message no such file or directory, open ‘package.json’ in NodeJS
- Introduction
- Attempt for Solving Error Message no such file or directory, open ‘package.json’ in NodeJS
- Another Solution for Solving the Error Message
- Final and Simple solution for Solving the Error Message
«ENOENT: no such file or directory» and others during npm install #18403
Note: I have managed to fight with this error, but if this can be of any help for debugging and making npm better, here’s my story. And plenty of logs, too.
I’m opening this issue because:
- npm is crashing.
- npm is producing an incorrect install.
- npm is doing something I don’t understand.
- Other (see below for feature requests):
What’s going wrong?
I was trying to install some dependencies. My package.json is well tested and, actually, identical one is running in a different directory just fine.
The error I’m getting:
ENOENT: no such file or directory, rename ‘C:Userswojte.SURFACE-PRO-4Projektyreact-collision-detectortestnode_modulescreate-react-class’ -> ‘C:Userswojte.SURFACE-PRO-4Projektyreact-collision-detectortestnode_modules.create-react-class.DELETE’
Here’s my package.json file that fails to install
https://pastebin.com/3Fp6sKM7
- the only interesting fact about my repo is that it refers to its parent folder (see line 17) to get one of the dependency (my repo is a test suite for another repo, placed in /test folder in it). However. ↙
- two almost identical (npm-wise) repos I own install just fine
- my parent repo has dependency react and react-dom both set to «>=15.5» . The repo I’m having an issue with is set to next , which downloads as of now version 16.0.0-beta.5.
- running npm install react@next produces the same error, heres the full log file: https://1drv.ms/u/s!AuDm0u3ORBtMvLNeY8b1ov67TcdiQA
I have tried the following:
- updating npm to the newest version — I was running 5.3.0 when I first saw the error.
- manually removing node_modules
- reinstalling npm and removing all its data in %appdata%.
After reinstalling npm, I’ve installed parent repo again. Worked like a charm. Sadly, installing this repo failed again, here’s the full log file: https://1drv.ms/u/s!AuDm0u3ORBtMvLNdsT7TP91kO9no8Q - removing package-lock.json files.
After that, with clean state, I’ve run npm install on parent repo again. I got error: — Error: EPERM: operation not permitted, unlink. . I believe it’s connected to
Error: EPERM: operation not permitted on npm 5.4 on windows #18380 . Here’s the full log file: https://1drv.ms/u/s!AuDm0u3ORBtMvLNfelh0ppRVPWKxzA
That did not help and I still were getting suggestion to run command as root/Administrator.
That finally fixed it!
How can the CLI team reproduce the problem?
supporting information:
- npm -v prints: 5.4.0
- node -v prints: v8.3.0
- npm config get registry prints: https://registry.npmjs.org/
- Windows, OS X/macOS, or Linux?: Windows 10, build 16281
- Network issues:
- Geographic location where npm was run: Kraków, Poland
- I use a proxy to connect to the npm registry.
- I use a proxy to connect to the web.
- I use a proxy when downloading Git repos.
- I access the npm registry via a VPN
- I don’t use a proxy, but have limited or unreliable internet access.
- I use super good optic fiber 500 Mbps connection in Poland’s best internet provider
- Container:
- I develop using Vagrant on Windows.
- I develop using Vagrant on OS X or Linux.
- I develop / deploy using Docker.
- I deploy to a PaaS (Triton, Heroku).
The text was updated successfully, but these errors were encountered:
Источник
How to Solve Error Message no such file or directory, open ‘package.json’ in NodeJS
Introduction
The error exist as part of the title of this article is actually happens. It happen upon executing the command of ‘npm i nodemon’. The following is the command upon triggering the error message :
The main purpose is for installing a nodemon package. The nodemon package is very useful. As it available in this link as one of the main source of the NodeJS information. It explains that nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
Moreover, in that link, it explains that nodemon does not require any additional changes to your code or method of development. Furthermore, nodemon is a replacement wrapper for node. Additionally, in order to use nodemon, replace the word node on the command line when executing your script. But apparently, upon installing the nodemon package, the error above appear. Normally, the error above will not appear upon the standard installation of any nodejs packages.
As an additional information, vefore starting to resolve the problem, the following is the content of the root folder of the NodeJS application :
Attempt for Solving Error Message no such file or directory, open ‘package.json’ in NodeJS
The node_modules folder is available after installing mysql module. But the installation of nodemon module fails.The following are the steps for solving the above error message :
1. First of all, try to initialize a NodeJS application. This will create a package.json file. The following is the execution of the command :
Fortunately, the execution for creating the package.json file is a success as in the above output. The full reference exist in this link. So, in the above command output, the file with the name of ‘package.json’ exist. So, it suppose it will be able to solve the error appear in the above line as follows :
2. Apparently, after executing the command again, the problem appear with another error message as follows :
3. Moreover, running the command ‘npm install’ to install the package dependencies as exist in the package.json file definition as follows is also failing :
Actually, the information about the ‘npm install’ command for further reference exist in this link.
4. Next, the attempt is to reinstall the npm package as follows :
5. Last but not least, it is an attempt directly to install the nodemon package as follows :
In the output of the above command execution, there is a problem with the permission in the operating system. Obviously, it is because the path is a path resulting of the folder mapping from the Windows operating system in the host machine.
So, the physical folder path of ‘/media/sf_windows’ actually exist in the host machine running with a Windows operating system.
Another Solution for Solving the Error Message
Since the problem is not in the npm tool either the NodeJS application itself, try to check the permission in the operating system. Below are attempts for solving it :
1. First of all, just try to set the SELinux mode into a permissive mode as follows :
2. After that, executing the ‘npm install nodemon –save’, it is still failing as in the previous output command. So, further attempt is to try to disable the SELinux by editing the file of ‘/etc/selinux/config’ and changing the following content :
3. Next, after restarting the virtual server and then reattempt to execute the ‘npm install nodemon –save’, unfortunately it still fail as in the output execution before.
Final and Simple solution for Solving the Error Message
After attempting for several alternative solutions above, finally this is the last attempt. Actually, it is a simple solution. Just try to execute in another folder exist in the guest machine or directly inside the virtual server as follows for an example in the ‘/root/tmp’ folder :
Luckily, it works although there is only one file with the name of ‘apps.js’. Actually, the content of that file is also just one line of source ‘console.debug(“Test NodeJS”);’. So, the conclusion for solving the problem is simple.
Generally, executing npm tool in a mounted folder originally exist as a physical folder in the host machine running in Windows operating system eventually will fail. Unfortunately, no further time to seek for the reason.
Источник
Photo from Unsplash
When running npm commands from the terminal, you may get an error with code ENOENT
.
Here’s an example of the error message log when running the npm start
command:
$ npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /nsebhastian/Desktop/DEV/n-app/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open
'/nsebhastian/Desktop/DEV/n-app/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
As you can see, there’s an error with code ENOENT
that prevents npm start
command from running successfully.
The code ENOENT
means that npm fails to open a file or directory that’s required for executing the command.
The npm start
command is used to run the start
script in the package.json
file.
When the package.json
file isn’t found, then npm throws the ENOENT
error.
To fix the error, you need to make sure that the file or directory needed for running the command is available.
In the case above, adding a package.json
file to the project will solve the error.
If that doesn’t work, then you probably don’t have a start
script in your package.json
file.
Learn more here: How to fix npm start command not working
Also, make sure that you are running the command from the project directory, right where the package.json
file is located.
npm commands don’t work when you run them from a parent or child directory.
npm install fails with code ENOENT
The ENOENT
error may also appear when you run the npm install
command.
Here’s an example of the error:
$ npm install
npm ERR! path /Users/nsebhastian/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename
'/Users/nsebhastian/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/nsebhastian/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
The error above happens because you have a dependency that doesn’t install correctly.
Here are the steps to resolve this issue:
- Make sure you are using the latest npm version
- Clean your npm cache
- Delete
node_modules
folder andpackage-lock.json
- Run
npm install
again
Run the following commands one by one from the terminal:
# 👇 update npm to the latest version
npm install -g npm@latest
# 👇 clean npm cache
npm cache clean --force
# 👇 delete node modules and package-lock.json
npm rm -rf node_modules && rm package-lock.json
# 👇 retry installing dependencies
npm install
The npm install
command should now run successfully.
And that’s how you solve the npm error code ENOENT: no such file or directory error.
I installed supertest
before installing debug
and it fixed this error.
Maybe make it a dependency of this module?
No. That’s not an issue of debug
package.
I think it’s related to NPM v3’s changed installation behavior.
You can resolve that issue by following methods:
- Ensure dependencies described correctly on
package.json
- Just type
npm install
and hit Enter. - Check issue still exists. and If issue not resolved, continue these methods.
- type
npm cache clean
and hit Enter - type
sudo npm install -g npm
and hit Enter. - Retry
npm install
and hit Enter.
if issue not resolved even tried these methods, Please reply with your Node.js version, NPM version, Operating System, and package.json
which is using.
xgqfrms-GitHub, AprilTong, yyfsyw, isrvamsi, ordsec, jorditambillo, gkarmas, kika-deploy, alexreyes, sundoze, and 2 more reacted with laugh emoji
IgnacioGaldames, davidreact, Wajahat-Hussain, xmaimom, jmizrachi, fredriikolsson, Bogdan323, xgqfrms-GitHub, RichardChiang, nakhhuan, and 11 more reacted with hooray emoji
devope reacted with confused emoji
xgqfrms-GitHub, yolisa, rawairawai, yyfsyw, cameck, jacktnugent, gkarmas, alexreyes, sundoze, deivoff, and 3 more reacted with heart emoji
@mooyoul I have that problem and tried your solution. But my problem did not resolve.
I am using mac os 10.11.4 and Node 6.2.2 and npm 3.9.5
The node_modules is in user/muser/node_modules/
I see mysql package in this folder
But when I try nam install
, below message appears on terminal:
npm WARN enoent ENOENT: no such file or directory, open '/Users/muser/package.json'
npm WARN muser No description
npm WARN muser No repository field.
npm WARN muser No README data
npm WARN muser No license field.
There is no package.json at '/Users/muser/package.json'
What is wrong in my setup? and how can I fix it.
@FaShapouri It seems trying npm install
in uninitialized npm package directory.
you should initialize package with npm init
.
If you want to use debug without package initialize, just use npm install debug
.
Kriel, oumou318, kaleem-elahi, EliVerbrugge, alexreyes, Nako68l, and zrhth5 reacted with laugh emoji
zrhth5 reacted with hooray emoji
Jay25patil, kaleem-elahi, smoliakov, adilbekes, alexreyes, and zhaolinnan12 reacted with confused emoji
Simply try npm install npm@latest -g it worked for me cheers.
purefan reacted with thumbs down emoji
This module does not use supertest
, and thus is not an issue for debug. Closing.
Try to change your node.js version
i am having problem installing npm …it keep getting this:
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/jamesosaedebiri/package.json’
Indeed what it wants is a package.json file, obtained by typing npm init. Then I was able to do an npm install with success.
WARN enoent ENOENT: no such file or directory, open ‘/home/nodeuser/hapi-mysql-unchained/node_modules/request/package.json’
npm WARN hapi-mysql-unchained@1.0.0 No description
npm WARN hapi-mysql-unchained@1.0.0 No repository field.
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv «/usr/bin/nodejs» «/usr/bin/npm» «install»
npm ERR! node v6.9.2
npm ERR! npm v4.2.0
npm ERR! path /home/nodeuser/hapi-mysql-unchained/node_modules/node-pre-gyp/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access ‘/home/nodeuser/hapi-mysql-unchained/node_modules/node-pre-gyp/node_modules’
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access ‘/home/nodeuser/hapi-mysql-unchained/node_modules/node-pre-gyp/node_modules’
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘access’,
npm ERR! path: ‘/home/nodeuser/hapi-mysql-unchained/node_modules/node-pre-gyp/node_modules’ }
- node.js version — v7.7.1
- npm version — 4.3.0
- operating system ubuntu 14.04
- package.json at /home/faltu/package.json is not there
if you are pretty new to Node/github/etc., you might be doing what I did — cloned a repo and then forgot to cd into the repo directory — so npm can’t find a package.json file, so it gives you that big convoluted error message.
i was operating in my main ‘dev’ directory:
~/dev$ npm install
but i needed to be in my cloned git directory:
~/dev/quiztool$ npm install
EdwardPerello, alexreyes, and d88naimi reacted with hooray emoji
EdwardPerello, alexreyes, and d88naimi reacted with heart emoji
ubuntu@ubuntu:~$ npm install debug
npm ERR! Linux 4.8.0-22-generic
npm ERR! argv «/home/ubuntu/.nvm/versions/node/v7.7.2/bin/node» «/home/ubuntu/.nvm/versions/node/v7.7.2/bin/npm» «install» «debug»
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network ‘proxy’ config is set properly. See: ‘npm help config’
npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/npm-debug.log
you can try «npm install -g bootstrap@4.0.0-alpha.6», i did it successfully in this way.
Please try, npm install npm@latest -g
the output you will get as below
C:Users*AppDataRoamingnpmnpm -> C:Users*AppDataRoamingnpmnode_modulesnpmbinnpm-cli.js
C:Users*****AppDataRoamingnpm
-- npm@4.4.4 +-- abbrev@1.1.0 +-- ansi-regex@2.1.1 +-- ansicolors@0.3.2 +-- ansistyles@0.1.3 +-- aproba@1.1.1 +-- archy@1.0.0 +-- asap@2.0.5 +-- bluebird@3.5.0 +-- call-limit@1.1.0 +-- chownr@1.0.1 +-- cmd-shim@2.0.2 +-- columnify@1.5.4 |
— wcwidth@1.0.0
| -- defaults@1.0.3 |
— clone@1.0.2
+— config-chain@1.1.11
| -- proto-list@1.2.4 +-- debuglog@1.0.1 +-- dezalgo@1.0.3 +-- editor@1.0.0 +-- fs-vacuum@1.2.10 +-- fs-write-stream-atomic@1.0.10 +-- fstream@1.0.11 +-- fstream-npm@1.2.0 |
— fstream-ignore@1.0.5
| -- minimatch@3.0.3 |
— brace-expansion@1.1.6
| +— balanced-match@0.4.2
| -- concat-map@0.0.1 +-- glob@7.1.1 | +-- fs.realpath@1.0.0 | +-- minimatch@3.0.3 | |
— brace-expansion@1.1.6
| | +— balanced-match@0.4.2
| | -- concat-map@0.0.1 |
— path-is-absolute@1.0.1
+— graceful-fs@4.1.11
+— has-unicode@2.0.1
+— hosted-git-info@2.2.0
+— iferr@0.1.5
+— imurmurhash@0.1.4
+— inflight@1.0.6
+— inherits@2.0.3
+— ini@1.3.4
+— init-package-json@1.9.5
| -- promzard@0.3.0 +-- JSONStream@1.3.1 | +-- jsonparse@1.3.0 |
— through@2.3.8
+— lazy-property@1.0.0
+— lockfile@1.0.3
+— lodash._baseindexof@3.1.0
+— lodash._baseuniq@4.6.0
| +— lodash._createset@4.0.3
| -- lodash._root@3.0.1 +-- lodash._bindcallback@3.0.1 +-- lodash._cacheindexof@3.0.2 +-- lodash._createcache@3.1.2 +-- lodash._getnative@3.9.1 +-- lodash.clonedeep@4.5.0 +-- lodash.restparam@3.6.1 +-- lodash.union@4.6.0 +-- lodash.uniq@4.5.0 +-- lodash.without@4.4.0 +-- mississippi@1.3.0 | +-- concat-stream@1.6.0 | |
— typedarray@0.0.6
| +— duplexify@3.5.0
| | +— end-of-stream@1.0.0
| | | -- once@1.3.3 | |
— stream-shift@1.0.0
| +— end-of-stream@1.1.0
| | -- once@1.3.3 | +-- flush-write-stream@1.0.2 | +-- from2@2.3.0 | +-- parallel-transform@1.1.0 | |
— cyclist@0.2.2
| +— pump@1.0.2
| +— pumpify@1.3.5
| +— stream-each@1.2.0
| | -- stream-shift@1.0.0 |
— through2@2.0.3
| -- xtend@4.0.1 +-- mkdirp@0.5.1 |
— minimist@0.0.8
+— move-concurrently@1.0.1
| +— copy-concurrently@1.0.3
| -- run-queue@1.0.3 +-- node-gyp@3.5.0 | +-- minimatch@3.0.3 | |
— brace-expansion@1.1.6
| | +— balanced-match@0.4.2
| | -- concat-map@0.0.1 |
— nopt@3.0.6
+— nopt@4.0.1
| -- osenv@0.1.4 | +-- os-homedir@1.0.2 |
— os-tmpdir@1.0.2
+— normalize-git-url@3.0.2
+— normalize-package-data@2.3.6
| -- is-builtin-module@1.0.0 |
— builtin-modules@1.1.1
+— npm-cache-filename@1.0.2
+— npm-install-checks@3.0.0
+— npm-package-arg@4.2.1
+— npm-registry-client@7.4.6
| -- concat-stream@1.6.0 |
— typedarray@0.0.6
+— npm-user-validate@0.1.5
+— npmlog@4.0.2
| +— are-we-there-yet@1.1.2
| | -- delegates@1.0.0 | +-- console-control-strings@1.1.0 | +-- gauge@2.7.2 | | +-- object-assign@4.1.0 | | +-- signal-exit@3.0.2 | | +-- string-width@1.0.2 | | | +-- code-point-at@1.1.0 | | |
— is-fullwidth-code-point@1.0.0
| | | -- number-is-nan@1.0.1 | | +-- supports-color@0.2.0 | |
— wide-align@1.1.0
| -- set-blocking@2.0.0 +-- once@1.4.0 +-- opener@1.4.3 +-- osenv@0.1.4 | +-- os-homedir@1.0.2 |
— os-tmpdir@1.0.2
+— path-is-inside@1.0.2
+— read@1.0.7
| -- mute-stream@0.0.5 +-- read-cmd-shim@1.0.1 +-- read-installed@4.0.3 |
— util-extend@1.0.3
+— read-package-json@2.0.5
| -- json-parse-helpfulerror@1.0.3 |
— jju@1.3.0
+— read-package-tree@5.1.5
+— readable-stream@2.2.3
| +— buffer-shims@1.0.0
| +— core-util-is@1.0.2
| +— isarray@1.0.0
| +— process-nextick-args@1.0.7
| +— string_decoder@0.10.31
| -- util-deprecate@1.0.2 +-- readdir-scoped-modules@1.0.2 +-- realize-package-specifier@3.0.3 +-- request@2.81.0 | +-- aws-sign2@0.6.0 | +-- aws4@1.6.0 | +-- caseless@0.12.0 | +-- combined-stream@1.0.5 | |
— delayed-stream@1.0.0
| +— extend@3.0.0
| +— forever-agent@0.6.1
| +— form-data@2.1.2
| | -- asynckit@0.4.0 | +-- har-validator@4.2.1 | | +-- ajv@4.11.4 | | | +-- co@4.6.0 | | |
— json-stable-stringify@1.0.1
| | | -- jsonify@0.0.0 | |
— har-schema@1.0.5
| +— hawk@3.1.3
| | +— boom@2.10.1
| | +— cryptiles@2.0.5
| | +— hoek@2.16.3
| | -- sntp@1.0.9 | +-- http-signature@1.1.1 | | +-- assert-plus@0.2.0 | | +-- jsprim@1.3.1 | | | +-- extsprintf@1.0.2 | | | +-- json-schema@0.2.3 | | |
— verror@1.3.6
| | -- sshpk@1.11.0 | | +-- asn1@0.2.3 | | +-- assert-plus@1.0.0 | | +-- bcrypt-pbkdf@1.0.1 | | +-- dashdash@1.14.1 | | +-- ecc-jsbn@0.1.1 | | +-- getpass@0.1.6 | | +-- jodid25519@1.0.2 | | +-- jsbn@0.1.1 | |
— tweetnacl@0.14.5
| +— is-typedarray@1.0.0
| +— isstream@0.1.2
| +— json-stringify-safe@5.0.1
| +— mime-types@2.1.14
| | -- mime-db@1.26.0 | +-- oauth-sign@0.8.2 | +-- performance-now@0.2.0 | +-- qs@6.4.0 | +-- safe-buffer@5.0.1 | +-- stringstream@0.0.5 | +-- tough-cookie@2.3.2 | |
— punycode@1.4.1
| -- tunnel-agent@0.6.0 +-- retry@0.10.1 +-- rimraf@2.6.1 +-- semver@5.3.0 +-- sha@2.0.1 +-- slide@1.1.6 +-- sorted-object@2.0.1 +-- sorted-union-stream@2.1.3 | +-- from2@1.3.0 | |
— readable-stream@1.1.14
| | +— core-util-is@1.0.2
| | +— isarray@0.0.1
| | -- string_decoder@0.10.31 |
— stream-iterate@1.1.1
+— strip-ansi@3.0.1
+— tar@2.2.1
| -- block-stream@0.0.8 +-- text-table@0.2.0 +-- uid-number@0.0.6 +-- umask@1.1.0 +-- unique-filename@1.1.0 |
— unique-slug@2.0.0
+— unpipe@1.0.0
+— update-notifier@2.1.0
| +— boxen@1.0.0
| | +— ansi-align@1.1.0
| | | -- string-width@1.0.2 | | | +-- code-point-at@1.1.0 | | |
— is-fullwidth-code-point@1.0.0
| | | -- number-is-nan@1.0.1 | | +-- camelcase@4.0.0 | | +-- cli-boxes@1.0.0 | | +-- string-width@2.0.0 | | |
— is-fullwidth-code-point@2.0.0
| | +— term-size@0.1.1
| | | -- execa@0.4.0 | | | +-- cross-spawn-async@2.2.5 | | | |
— lru-cache@4.0.2
| | | | +— pseudomap@1.0.2
| | | | -- yallist@2.0.0 | | | +-- is-stream@1.1.0 | | | +-- npm-run-path@1.0.0 | | | +-- object-assign@4.1.1 | | | +-- path-key@1.0.0 | | |
— strip-eof@1.0.0
| | -- widest-line@1.0.0 | |
— string-width@1.0.2
| | +— code-point-at@1.1.0
| | -- is-fullwidth-code-point@1.0.0 | |
— number-is-nan@1.0.1
| +— chalk@1.1.3
| | +— ansi-styles@2.2.1
| | +— escape-string-regexp@1.0.5
| | +— has-ansi@2.0.0
| | -- supports-color@2.0.0 | +-- configstore@3.0.0 | | +-- dot-prop@4.1.1 | | |
— is-obj@1.0.1
| | -- unique-string@1.0.0 | |
— crypto-random-string@1.0.0
| +— is-npm@1.0.0
| +— latest-version@3.0.0
| | -- package-json@3.1.0 | | +-- got@6.7.1 | | | +-- create-error-class@3.0.2 | | | |
— capture-stack-trace@1.0.0
| | | +— duplexer3@0.1.4
| | | +— get-stream@3.0.0
| | | +— is-redirect@1.0.0
| | | +— is-retry-allowed@1.1.0
| | | +— is-stream@1.1.0
| | | +— lowercase-keys@1.0.0
| | | +— safe-buffer@5.0.1
| | | +— timed-out@4.0.1
| | | +— unzip-response@2.0.1
| | | -- url-parse-lax@1.0.0 | | |
— prepend-http@1.0.4
| | +— registry-auth-token@3.1.0
| | | -- rc@1.1.7 | | | +-- deep-extend@0.4.1 | | | +-- minimist@1.2.0 | | |
— strip-json-comments@2.0.1
| | -- registry-url@3.1.0 | |
— rc@1.1.7
| | +— deep-extend@0.4.1
| | +— minimist@1.2.0
| | -- strip-json-comments@2.0.1 | +-- lazy-req@2.0.0 | +-- semver-diff@2.1.0 |
— xdg-basedir@3.0.0
+— uuid@3.0.1
+— validate-npm-package-license@3.0.1
| +— spdx-correct@1.0.2
| | -- spdx-license-ids@1.2.0 |
— spdx-expression-parse@1.0.2
| +— spdx-exceptions@1.0.4
| -- spdx-license-ids@1.2.0 +-- validate-npm-package-name@3.0.0 |
— builtins@1.0.3
+— which@1.2.12
| -- isexe@1.1.2 +-- wrappy@1.0.2
— write-file-atomic@1.3.1
later install bootstrap, try below
$ npm install -g bootstrap@4.0.0-alpha.6
C:Users******AppDataRoamingnpm
-- bootstrap@4.0.0-alpha.6 +-- jquery@3.2.1
— tether@1.4.0
while publishing my package was having package.json… so why it is not downloaded when i am installing my package
New to node… setup EC2 > AMAZON linux.. Node setup.. tried all kinds of versions..
no matter what i do, errors are obtained during install..
tried npm init… tried diff versions of all parts… still I can’t get a successful install & test code always fails.
Errors below. Please advise
npm install pdfkit
npm WARN saveError ENOENT: no such file or directory, open ‘/home/ec2-user/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/ec2-user/package.json’
npm WARN ec2-user No description
npm WARN ec2-user No repository field.
npm WARN ec2-user No README data
npm WARN ec2-user No license field.
npm WARN ec2-user Invalid dependency: png-js undefined
No matter what I install or how, i get these:
npm WARN saveError ENOENT: no such file or directory, open ‘/home/ec2-user/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/home/ec2-user/package.json’
You have to cd into location where package.json is; like assets in phoenix 1.3.x
Angular 2 project not run forever show these errors:
npm ERR! path /package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open ‘/package.json’
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! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-05-30T12_02_40_976Z-debug.log
error: Forever detected script exited with code: 254
error: Script restart attempt #1
npm ERR! path /package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open ‘/package.json’
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
OS: Mac Sierra 10.12.5
Node v8.0.0.0
NPM v5.0.0
I’m having the same problem as well. I can’t seem to resolve this. I’ve tried both with and without sudo. I do have other programs installed in my computer. Don’t know if that has something to do with it. I have all of the Python Stack and Ruby Stack installed. Now trying to get all the MEAN Stack components installed.
Below is what I’m getting back. Any help would be greatly appreciated. When it talks about dependencies, I have no idea what that is.. Sorry for my poor knowledge.
TERMINAL:
Jaes-MacBook-Pro:bower_install jaepark75$ sudo npm install jquery
Password:
npm WARN saveError ENOENT: no such file or directory, open ‘/Users/jaepark75/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/jaepark75/package.json’
npm WARN jaepark75 No description
npm WARN jaepark75 No repository field.
npm WARN jaepark75 No README data
npm WARN jaepark75 No license field.
npm WARN jaepark75 Invalid dependency: balanced-match undefined
npm WARN jaepark75 Invalid dependency: block-stream undefined
npm WARN jaepark75 Invalid dependency: brace-expansion undefined
npm WARN jaepark75 Invalid dependency: concat-map undefined
npm WARN jaepark75 Invalid dependency: fs.realpath undefined
npm WARN jaepark75 Invalid dependency: fstream undefined
npm WARN jaepark75 Invalid dependency: glob undefined
npm WARN jaepark75 Invalid dependency: graceful-fs undefined
npm WARN jaepark75 Invalid dependency: hammerjs undefined
npm WARN jaepark75 Invalid dependency: inflight undefined
npm WARN jaepark75 Invalid dependency: inherits undefined
npm WARN jaepark75 Invalid dependency: materialize-css undefined
npm WARN jaepark75 Invalid dependency: minimatch undefined
npm WARN jaepark75 Invalid dependency: minimist undefined
npm WARN jaepark75 Invalid dependency: mkdirp undefined
npm WARN jaepark75 Invalid dependency: node-archiver undefined
npm WARN jaepark75 Invalid dependency: once undefined
npm WARN jaepark75 Invalid dependency: path-is-absolute undefined
npm WARN jaepark75 Invalid dependency: rimraf undefined
npm WARN jaepark75 Invalid dependency: tar undefined
npm WARN jaepark75 Invalid dependency: wrappy undefined
updated 1 package in 4.539s
Hi,
I’ve got the same problem here and tried to run the following commands above to fix this. «Clean Cache» & «re-install». Unfortunately it didn’t fix it for me. Seems to have spawned another issue.
/Users/Karbon62/.npm/_logs/2017-06-05T14_42_36_153Z-debug.log
Before running the commands to fix this, my console was giving me this error:
file:///Users/Karbon62/.npm/_logs/2017-06-05T12_47_17_209Z-debug.log
OS: Mac Sierra 10.12.5
Node v8.0.0.0
NPM v5.0.2
i’ve the same probelm than jimmymixer whitout sucess.
If any have a idea to dig… Thank
TERMINAL:
_MacBook-Air-de-happy:~ happy$ npm install airsonos -g
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 static-favicon@1.0.2: use serve-favicon module
npm WARN deprecated react-tools@0.13.3: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/local/bin/airsonos -> /usr/local/lib/node_modules/airsonos/bin/index.js
- airsonos@0.2.6_
then i installed latest «minimatch», «serve-favicon» and «react»
then
TERMINAL:
_MacBook-Air-de-happy:~ happy$ airsonos
Searching for Sonos devices on network…
/usr/local/lib/node_modules/airsonos/node_modules/bluebird/js/main/promise.js:680
throw e;
^
Error: Internal Server Error
at maybeWrapAsError (/usr/local/lib/node_modules/airsonos/node_modules/bluebird/js/main/util.js:70:12)
at /usr/local/lib/node_modules/airsonos/node_modules/bluebird/js/main/promise_resolver.js:41:50
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/logicalDevice.js:112:20
at done (/usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/logicalDevice.js:106:22
at done (/usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:251:17
at done (/usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:126:15)
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:32:16
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:248:21
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/node_modules/async/lib/async.js:572:34
at /usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/events/volumeListener.js:24:14
at Listener. (/usr/local/lib/node_modules/airsonos/node_modules/sonos/lib/events/listener.js:123:9)
at Request.self.callback (/usr/local/lib/node_modules/airsonos/node_modules/request/request.js:129:22)_
-
Create a package.json file and store it in the folder where you will install the npm package. Keep it simple for now. This npm video helped me. Also read Using a package.json for additional information. The following example satisfies the minimum requirements:
{
«name»: «demo-app»,
«version»: «1.0.0»
} -
Open Terminal: as @mihai-ciupina pointed out… cd to the location where you want to store the package locally. If you type ls you should see the package.json file you just created.
-
Type: npm install <package_name>. The video above discusses variations you can type.
-
I’m not sure why, but my folder also created a package-lock.json file. I will have to do some more reading on this.
Im trying to install gulp and I keep having thises issues:
Ive tried many remedies including: npm install npm@latest and still no progress.
C:Usershome>npm install npm@latest -g
C:UsershomeAppDataRoamingnpmnpm -> C:UsershomeAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js
- npm@5.0.3
updated 1 package in 24.356s
C:UsersM-Corp>npm install gulp
npm WARN saveError ENOENT: no such file or directory, open ‘C:Usershomepackage.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:Usershomepackage.json’
npm WARN home No description
npm WARN home No repository field.
npm WARN home No README data
npm WARN home No license field.
- gulp@3.9.1
updated 1 package in 2.495s
C:Usershome>
u just need to create package.json file in the needing directory, and enter npm init
. It’s ok, and i tried successfully. Hope for u…
Did anyone find a solution to this yet? I highly doubt that they haven’t fixed this bug yet.
Simply remove node_modules then run again ‘npm install’
when i run
$ npm install express
, i got the following error.
rank@rank-ThinkCentre-M73:~$ npm install express
npm ERR! Linux 3.16.0-57-generic
npm ERR! argv «/home/rank/.nvm/versions/node/v5.0.0/bin/node» «/home/rank/.nvm/versions/node/v5.0.0/bin/npm» «install» «express»
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect
npm ERR! Error: connect ECONNREFUSED 127.0.0.1:8080
npm ERR! at Object.exports._errnoException (util.js:860:11)
npm ERR! at exports._exceptionWithHostPort (util.js:883:20)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
npm ERR! { [Error: connect ECONNREFUSED 127.0.0.1:8080]
npm ERR! code: ‘ECONNREFUSED’,
npm ERR! errno: ‘ECONNREFUSED’,
npm ERR! syscall: ‘connect’,
npm ERR! address: ‘127.0.0.1’,
npm ERR! port: 8080 }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! ‘proxy’ config is set properly. See: ‘npm help config’
npm ERR! Please include the following file with any support request:
npm ERR! /home/rank/npm-debug.log
rank@rank-ThinkCentre-M73:~$
debug-js
locked and limited conversation to collaborators
Sep 5, 2017
debug
is not a repository to post your generic NPM-related problems; it’s a specific package that has nothing to do with most of the comments here.
Locking due to chatter. If you’re having lots of problems with NPM, might I suggest StackOverflow (please search first before asking a question). Alternatively, check out @mooyoul’s answer.
Introduction
The error exist as part of the title of this article is actually happens. It happen upon executing the command of ‘npm i nodemon’. The following is the command upon triggering the error message :
[root@10 crud]# npm i nodemon npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN enoent ENOENT: no such file or directory, open '/media/sf_windows/nodejs/crud/package.json' npm WARN crud No description npm WARN crud No repository field. npm WARN crud No README data npm WARN crud No license field. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /media/sf_windows/nodejs/crud/node_modules/chalk/node_modules/supports-color/package.json.2679617430 npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/media/sf_windows/nodejs/crud/node_modules/chalk/node_modules/supports-color/package.json.2679617430' 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! /root/.npm/_logs/2021-03-04T10_40_27_067Z-debug.log [root@10 crud]#
The main purpose is for installing a nodemon package. The nodemon package is very useful. As it available in this link as one of the main source of the NodeJS information. It explains that nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
Moreover, in that link, it explains that nodemon does not require any additional changes to your code or method of development. Furthermore, nodemon is a replacement wrapper for node. Additionally, in order to use nodemon, replace the word node on the command line when executing your script. But apparently, upon installing the nodemon package, the error above appear. Normally, the error above will not appear upon the standard installation of any nodejs packages.
As an additional information, vefore starting to resolve the problem, the following is the content of the root folder of the NodeJS application :
[root@10 crud]# ls -al total 13 drwxrwx---. 1 root vboxsf 4096 Mar 4 05:31 . drwxrwx---. 1 root vboxsf 4096 Mar 4 05:25 .. -rwxrwx---. 1 root vboxsf 207 Feb 27 12:18 db_config.js drwxrwx---. 1 root vboxsf 0 Feb 10 11:29 node_modules -rwxrwx---. 1 root vboxsf 3136 Feb 10 11:29 package-lock.json [root@10 crud]#
The node_modules folder is available after installing mysql module. But the installation of nodemon module fails.The following are the steps for solving the above error message :
1. First of all, try to initialize a NodeJS application. This will create a package.json file. The following is the execution of the command :
[root@10 crud]# npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help init` for definitive documentation on these fields and exactly what they do. Use `npm install ` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. package name: (crud) version: (1.0.0) description: entry point: (app.js) test command: git repository: keywords: author: license: (ISC) About to write to /media/sf_windows/nodejs/crud/package.json: { "name": "crud", "version": "1.0.0", "description": "", "main": "app.js", "dependencies": { "ansi-align": "^3.0.0", "braces": "^3.0.2", "anymatch": "^3.1.1", "clone-response": "^1.0.2", "chokidar": "^3.5.1", "decompress-response": "^3.3.0", "debug": "^3.2.7", "fill-range": "^7.0.1", "end-of-stream": "^1.4.4", "get-stream": "^4.1.0", "ignore-by-default": "^1.0.1", "ms": "^2.1.3", "minimist": "^1.2.5", "minimatch": "^3.0.4", "mimic-response": "^1.0.1", "mysql": "^2.18.1", "normalize-url": "^4.5.0", "normalize-path": "^3.0.0", "nopt": "^1.0.10", "once": "^1.4.0", "picomatch": "^2.2.2", "p-cancelable": "^1.1.0", "prepend-http": "^2.0.0", "pupa": "^2.1.1", "pump": "^3.0.0", "pstree.remy": "^1.1.8", "readdirp": "^3.5.0", "responselike": "^1.0.2", "registry-auth-token": "^4.2.1", "registry-url": "^5.1.0", "rc": "^1.2.8", "semver": "^5.7.1", "semver-diff": "^3.1.1", "signal-exit": "^3.0.3", "supports-color": "^5.5.0", "strip-json-comments": "^2.0.1", "string-width": "^4.2.2", "term-size": "^2.2.1", "strip-ansi": "^5.2.0", "to-regex-range": "^5.0.1", "type-fest": "^0.8.1", "to-readable-stream": "^1.0.0", "url-parse-lax": "^3.0.0", "touch": "^3.1.0", "typedarray-to-buffer": "^3.1.5", "undefsafe": "^2.0.3", "unique-string": "^2.0.0", "widest-line": "^3.1.0", "wrappy": "^1.0.2", "xdg-basedir": "^4.0.0", "write-file-atomic": "^3.0.3" }, "devDependencies": {}, "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "author": "", "license": "ISC" } Is this OK? (yes) y [root@10 crud]# [root@10 crud]# ls -al total 57 drwxrwx---. 1 root vboxsf 4096 Mar 4 05:56 . drwxrwx---. 1 root vboxsf 4096 Mar 4 05:25 .. -rwxrwx---. 1 root vboxsf 188 Mar 4 05:56 app.js -rwxrwx---. 1 root vboxsf 207 Feb 27 12:18 db_config.js drwxrwx---. 1 root vboxsf 40960 Mar 4 05:41 node_modules -rwxrwx---. 1 root vboxsf 1703 Mar 4 05:41 package.json -rwxrwx---. 1 root vboxsf 3136 Feb 10 11:29 package-lock.json [root@10 crud]#
Fortunately, the execution for creating the package.json file is a success as in the above output. The full reference exist in this link. So, in the above command output, the file with the name of ‘package.json’ exist. So, it suppose it will be able to solve the error appear in the above line as follows :
npm WARN enoent ENOENT: no such file or directory, open '/media/sf_windows/nodejs/crud/package.json'
2. Apparently, after executing the command again, the problem appear with another error message as follows :
[root@10 crud]# npm i nodemon npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN crud@1.0.0 No description npm WARN crud@1.0.0 No repository field. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /media/sf_windows/nodejs/crud/node_modules/cacheable-request/node_modules/pump/package.json.3495354389 npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/media/sf_windows/nodejs/crud/node_modules/cacheable-request/node_modules/pump/package.json.3495354389' 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! /root/.npm/_logs/2021-03-04T10_41_50_349Z-debug.log [root@10 crud]#
3. Moreover, running the command ‘npm install’ to install the package dependencies as exist in the package.json file definition as follows is also failing :
[root@10 crud]# npm install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN crud@1.0.0 No description npm WARN crud@1.0.0 No repository field. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /media/sf_windows/nodejs/crud/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json.2484783542 npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/media/sf_windows/nodejs/crud/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json.2484783542' 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! /root/.npm/_logs/2021-03-04T10_58_26_376Z-debug.log [root@10 crud]#
Actually, the information about the ‘npm install’ command for further reference exist in this link.
4. Next, the attempt is to reinstall the npm package as follows :
[root@10 crud]# npm install npm -g /usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js + npm@7.6.0 added 59 packages from 24 contributors, removed 241 packages and updated 194 packages in 19.783s [root@10 crud]#
5. Last but not least, it is an attempt directly to install the nodemon package as follows :
[root@10 crud]# npm install nodemon --save npm ERR! code EPERM npm ERR! syscall symlink npm ERR! path ../is-ci/bin.js npm ERR! dest /media/sf_windows/nodejs/crud/node_modules/.bin/is-ci npm ERR! errno -1 npm ERR! Error: EPERM: operation not permitted, symlink '../is-ci/bin.js' -> '/media/sf_windows/nodejs/crud/node_modules/.bin/is-ci' npm ERR! [Error: EPERM: operation not permitted, symlink '../is-ci/bin.js' -> '/media/sf_windows/nodejs/crud/node_modules/.bin/is-ci'] { npm ERR! errno: -1, npm ERR! code: 'EPERM', npm ERR! syscall: 'symlink', npm ERR! path: '../is-ci/bin.js', npm ERR! dest: '/media/sf_windows/nodejs/crud/node_modules/.bin/is-ci' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-03-04T15_30_35_961Z-debug.log [root@10 crud]#
In the output of the above command execution, there is a problem with the permission in the operating system. Obviously, it is because the path is a path resulting of the folder mapping from the Windows operating system in the host machine.
So, the physical folder path of ‘/media/sf_windows’ actually exist in the host machine running with a Windows operating system.
Another Solution for Solving the Error Message
Since the problem is not in the npm tool either the NodeJS application itself, try to check the permission in the operating system. Below are attempts for solving it :
1. First of all, just try to set the SELinux mode into a permissive mode as follows :
[root@10 crud]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 32 [root@10 crud]# setenforce 0 [root@10 crud]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 32 [root@10 crud]#
2. After that, executing the ‘npm install nodemon –save’, it is still failing as in the previous output command. So, further attempt is to try to disable the SELinux by editing the file of ‘/etc/selinux/config’ and changing the following content :
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. #SELINUX=enforcing SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
3. Next, after restarting the virtual server and then reattempt to execute the ‘npm install nodemon –save’, unfortunately it still fail as in the output execution before.
Final and Simple solution for Solving the Error Message
After attempting for several alternative solutions above, finally this is the last attempt. Actually, it is a simple solution. Just try to execute in another folder exist in the guest machine or directly inside the virtual server as follows for an example in the ‘/root/tmp’ folder :
[root@10 temp]# ls -al total 4 drwxr-xr-x 2 root root 20 Mar 4 10:42 . dr-xr-x---. 6 root root 249 Mar 4 09:07 .. -rw-r--r-- 1 root root 31 Mar 4 09:07 app.js [root@10 temp]# npm install nodemon --save added 119 packages, and audited 120 packages in 7s 11 packages are looking for funding run `npm fund` for details found 0 vulnerabilities [root@10 temp]# ls -al total 92 drwxr-xr-x 3 root root 85 Mar 4 10:42 . dr-xr-x---. 6 root root 249 Mar 4 09:07 .. -rw-r--r-- 1 root root 31 Mar 4 09:07 app.js drwxr-xr-x 108 root root 4096 Mar 4 10:42 node_modules -rw-r--r-- 1 root root 52 Mar 4 10:42 package.json -rw-r--r-- 1 root root 78919 Mar 4 10:42 package-lock.json [root@10 temp]#
Luckily, it works although there is only one file with the name of ‘apps.js’. Actually, the content of that file is also just one line of source ‘console.debug(“Test NodeJS”);’. So, the conclusion for solving the problem is simple.
Generally, executing npm tool in a mounted folder originally exist as a physical folder in the host machine running in Windows operating system eventually will fail. Unfortunately, no further time to seek for the reason.