u010412440
com_jia
2019-04-01 15:23

oracledb、jsonschema等无法全局安装

  • node.js

npm配置:

D:\>npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.4.1 node/v10.15.0 win32 x64"

; userconfig C:\Users\zyjia\.npmrc
cache = "D:\\program\\nodejs\\npm_cache"
prefix = "D:\\program\\nodejs\\npm_global"

; builtin config undefined

; node bin location = D:\program\nodejs\node.exe
; cwd = D:\
; HOME = C:\Users\zzz
; "npm config ls -l" to show all defaults.


已安装包

D:\>npm list -g
D:\program\nodejs\npm_global
+-- frisby@2.1.1
| +-- encoding@0.1.12
| | `-- iconv-lite@0.4.24
| |   `-- safer-buffer@2.1.2
| +-- form-data@2.3.3
| | +-- asynckit@0.4.0
| | +-- combined-stream@1.0.7
| | | `-- delayed-stream@1.0.0
| | `-- mime-types@2.1.22
| |   `-- mime-db@1.38.0
| +-- joi@13.7.0
| | +-- hoek@5.0.4
| | +-- isemail@3.2.0
| | | `-- punycode@2.1.1
| | `-- topo@3.0.3
| |   `-- hoek@6.1.3
| +-- lodash@4.17.11
| `-- node-fetch@2.3.0
+-- hoek@6.1.3
+-- jsonschema@1.2.4
`-- oracledb@3.1.2

D:\>

环境变量
NODE_PATH : D:\program\nodejs\npm_global\node_modules
Path : D:\program\nodejs\;D:\program\nodejs\npm_global;
但是不生效

D:\>node
> var a=require("oracledb");
{ Error: Cannot find module 'oracledb'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18) code: 'MODULE_NOT_FOUND' }
>

node.js版本

D:\>node -v
v10.15.0

D:\>
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答