Let's for the sake of simplicity, say that I have a folder structure like so:
root
|-build
|-package.json
|-src
|-foo
|-foo.csproj
|-foo.cs
|-bar.cs
|-bin
|-...
|-foo.sln
Let us then say that I change the current directory to root\src\foo\bin
and execute any npm
command, say for example the npm install
command like so:
C:\root\src\foo\bin> npm install
We will observe that npm will start looking for the package.json
file within the current directory, and since it won't find it, will report an error like so:
npm ERR! path C:\root\src\foo\bin\package.json
npm ERR! code ENOENT
1> npm ERR! errno -4058
1> npm ERR! syscall open
1> npm ERR! enoent ENOENT: no such file or directory, open 'C:\root\src\foo\bin\package.json'
1> npm ERR! enoent This is related to npm not being able to find a file.
1> npm ERR! enoent
In this case, supposing I had a limitation that I had to execute all commands from within the root\src\foo\bin\
folder, how would I tell npm to look for the package.json
file that's in the root\build\
folder?