相关疑难解决方法(0)

在Windows上运行Python以获取Node.js依赖项

我正在进入Node.js代码库,这需要我通过NPM下载一些依赖项,即jQuery.

在尝试运行时npm install jquery,我不断收到此错误:

Your environment has been set up for using Node.js 0.8.21 (x64) and NPM

C:\Users\Matt Cashatt>npm install jquery
npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/contextify
npm …
Run Code Online (Sandbox Code Playgroud)

python windows node.js npm

217
推荐指数
13
解决办法
31万
查看次数

"找不到Python可执行文件......" - npm install挂起

我正在使用"npm install"来下载和编译我编写的一个小node.js应用程序的所有依赖项.我使用的"package.json"文件是正确的,包含所有需要的信息.

其中一个要安装的软件包有"node-gyp"作为依赖项,所以我之前安装了"python2"软件包.

现在,在某个时刻我开始收到错误消息:

> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:103:14)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:42:11
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:40:25)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:43:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:54:16
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:99:15)
gyp ERR! System Linux 3.18.9-200.fc21.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /srv/visitor/node_modules/phantom/node_modules/dnode/node_modules/weak
gyp ERR! node -v …
Run Code Online (Sandbox Code Playgroud)

python environment-variables node.js python-2.7

9
推荐指数
2
解决办法
3万
查看次数

错误运行npm i时出错(退出代码1):离子错误

我开始研究离子,我对此非常陌生,并且按照本教程,我知道已经问过这类问题,但没有适当的解决方案,请提供解决方案,第一步跟随,

1.已安装节点 - node-v8.9.0-x86
2.运行命令npm install -g cordova ionic

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\Android1\AppData\Roaming\npm\cordova -> 
C:\Users\Android1\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\Android1\AppData\Roaming\npm\ionic -> 
C:\Users\Android1\AppData\Roaming\npm\node_modules\ionic\bin\ionic
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 
(node_modules\ionic\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"win32","arch":"ia32"})

+ cordova@7.1.0
+ ionic@3.16.0
added 115 packages and updated 2 packages in 69.815s
Run Code Online (Sandbox Code Playgroud)
  1. 然后运行命令ionic start myApp tabs ,得到以下错误

在此输入图像描述

谢谢,

node.js cordova ionic-framework

6
推荐指数
2
解决办法
2万
查看次数

如何将Tesseract导入Angular2(TypeScript)

我正在尝试将Tesseract导入Angular2(TypeScript).我可以看到它保存到node_modules文件夹中,但在使用时

import { Tesseract } from '@types/tesseract.js';

它说:

[ts]模块'"c:/Users/black/Projects/projectCLI/tess/node_modules/@types/tesseract.js/index"'没有导出成员'Tesseract'.

在index.d.ts文件中有一个名为Tesseract的命名空间.

有没有其他方法来导入这个或我们是否以错误的方式看待这个?

我曾经npm install --save-dev @types/tesseract.js安装过打字稿Tesseract.

如果有任何使用tesseract的演示教程,请将它们链接到这里吗?

在此先感谢您的帮助.

javascript ocr tesseract angular

5
推荐指数
1
解决办法
3520
查看次数

安装Karma失败了

试图安装Karma

npm install -g karma
Run Code Online (Sandbox Code Playgroud)

产生警告

npm WARN optional dep failed, continuing fsevents@0.3.5
Run Code Online (Sandbox Code Playgroud)

最后似乎没有安装Karma

karma init karma.config.js
'karma' is not recognized as an internal or external command (so a windows installation).
Run Code Online (Sandbox Code Playgroud)

然而,似乎有一个业力

C:\Users\Me\AppData\Roaming\npm\node_modules\karma
Run Code Online (Sandbox Code Playgroud)

和一个builerror.log文件

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack     at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! …
Run Code Online (Sandbox Code Playgroud)

npm angularjs karma-jasmine

4
推荐指数
1
解决办法
1911
查看次数