我在Windows机器上使用npm 3.10.10,并且我试图从包含npm install
目录的目录上一级目录运行package.json
:
userfrosting/
build/
package.json
我正在使用prefix
configuration option,这应该允许我这样做。在userfrosting/
目录中:
npm install --prefix "build/" -ddd
这会产生以下错误:
npm ERR! eisdir EISDIR: illegal operation on a directory, read
如果我直接在npm install
内运行build/
,则效果非常好。我需要能够从这个父目录运行它,因为它是更大的构建工具的一部分。
此问题仅发生在Windows环境中 - 我已在* nix系统上运行它 没有这个问题。
我的package.json
按http://package-json-validator.com/传递验证。
完整的详细输出如下:
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--prefix',
npm verb cli 'build/node_modules',
npm verb cli '-ddd' ]
npm info using npm@3.10.10
npm info using node@v6.11.0
npm sill loadCurrentTree Starting
npm sill install loadCurrentTree
npm sill install readGlobalPackageData
npm sill fetchPackageMetaData .
npm sill fetchOtherPackageData .
npm sill cache add args [ '.', null ]
npm verb cache add spec .
npm sill cache add parsed spec Result {
npm sill cache add raw: '.',
npm sill cache add scope: null,
npm sill cache add escapedName: null,
npm sill cache add name: null,
npm sill cache add rawSpec: '.',
npm sill cache add spec: 'D:\\dev\\userfrosting',
npm sill cache add type: 'local' }
npm ERR! addLocal Could not install D:\dev\userfrosting
npm sill fetchPackageMetaData Error: EISDIR: illegal operation on a directory, read
npm sill fetchPackageMetaData at Error (native)
npm sill fetchPackageMetaData error for . { Error: EISDIR: illegal operation on a directory, read
npm sill fetchPackageMetaData at Error (native) errno: -4068, code: 'EISDIR', syscall: 'read' }
npm sill rollbackFailedOptional Starting
npm sill rollbackFailedOptional Finishing
npm sill runTopLevelLifecycles Finishing
npm sill install printInstalled
npm verb stack Error: EISDIR: illegal operation on a directory, read
npm verb stack at Error (native)
npm verb cwd D:\dev\userfrosting
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--prefix" "build/node_modules" "-ddd"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall read
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
npm verb exit [ -4068, true ]
npm ERR! Please include the following file with any support request:
npm ERR! D:\dev\userfrosting\npm-debug.log