Install sqlite3 on windows

≡放荡痞女 提交于 2019-12-08 05:11:28

问题


I am trying to use "electron": "^4.1.4", with "sqlite3": "^4.0.6" on windows 8.1 and node v10.15.3.

I tried to install windows-build-tools, like:

npm install --global --production windows-build-tools@4.0.0

Furthermore, I used electron-rebuild -w sqlite3 which:

V Rebuild Complete

The operation ran through successfully, however, when trying to install npm install sqlite3 --save I get:

62 silly saveTree `-- sqlite3@4.0.6
62 silly saveTree   +-- nan@2.10.0
62 silly saveTree   `-- node-pre-gyp@0.11.0
62 silly saveTree     +-- needle@2.3.0
62 silly saveTree     | `-- debug@4.1.1
62 silly saveTree     +-- nopt@4.0.1
62 silly saveTree     +-- npm-packlist@1.4.1
62 silly saveTree     | +-- ignore-walk@3.0.1
62 silly saveTree     | `-- npm-bundled@1.0.6
62 silly saveTree     `-- tar@4.4.8
62 silly saveTree       +-- chownr@1.1.1
62 silly saveTree       +-- fs-minipass@1.2.5
62 silly saveTree       | `-- minipass@2.3.5
62 silly saveTree       |   `-- yallist@3.0.3
62 silly saveTree       +-- minipass@2.3.5
62 silly saveTree       +-- minizlib@1.2.1
62 silly saveTree       `-- yallist@3.0.3
63 verbose stack Error: EPERM: operation not permitted, unlink 'C:\Users\admin\Desktop\projects\mytestapp\node_modules\.sqlite3.DELETE\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node'
64 verbose cwd C:\Users\admin\Desktop\projects\mytestapp
65 verbose Windows_NT 6.3.9600
66 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
67 verbose node v10.15.3
68 verbose npm  v6.9.0
69 error path C:\Users\admin\Desktop\projects\mytestapp\node_modules\.sqlite3.DELETE\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node
70 error code EPERM
71 error errno -4048
72 error syscall unlink
73 error Error: EPERM: operation not permitted, unlink 'C:\Users\admin\Desktop\projects\mytestapp\node_modules\.sqlite3.DELETE\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node'
73 error  { [Error: EPERM: operation not permitted, unlink 'C:\Users\admin\Desktop\projects\mytestapp\node_modules\.sqlite3.DELETE\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node']
73 error   cause:
73 error    { Error: EPERM: operation not permitted, unlink 'C:\Users\admin\Desktop\projects\mytestapp\node_modules\.sqlite3.DELETE\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node'
73 error      errno: -4048,
73 error      code: 'EPERM',
73 error      syscall: 'unlink',
73 error      path:
73 error       'C:\\Users\\admin\\Desktop\\projects\\mytestapp\\node_modules\\.sqlite3.DELETE\\lib\\binding\\electron-v4.1-win32-x64\\node_sqlite3.node' },
73 error   stack:
73 error    'Error: EPERM: operation not permitted, unlink \'C:\\Users\\admin\\Desktop\\projects\\mytestapp\\node_modules\\.sqlite3.DELETE\\lib\\binding\\electron-v4.1-win32-x64\\node_sqlite3.node\'',
73 error   errno: -4048,
73 error   code: 'EPERM',
73 error   syscall: 'unlink',
73 error   path:
73 error    'C:\\Users\\admin\\Desktop\\projects\\mytestapp\\node_modules\\.sqlite3.DELETE\\lib\\binding\\electron-v4.1-win32-x64\\node_sqlite3.node',
73 error   parent: 'mytestapp' }
74 error The operation was rejected by your operating system.
74 error It's possible that the file was already in use (by a text editor or antivirus),
74 error or that you lack permissions to access it.
74 error
74 error If you believe this might be a permissions issue, please double-check the
74 error permissions of the file and its containing directories, or try running
74 error the command again as root/Administrator (though this is not recommended).
75 verbose exit [ -4048, true ]

As you can see I get an error!

Any suggestions what I am doing wrong?

I appreciate your replies!


回答1:


You should tried like as below. It was helpful for me

Add into you package.json

"scripts": {
        "postinstall": "install-app-deps",
 }

Run command like npm run postinstall



来源:https://stackoverflow.com/questions/56011415/install-sqlite3-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!