gpt4 book ai didi

python - .NET Core 2.0 和 Angular 初始应用程序构建失败 - 找不到 python 后跟 JavaScript 运行时错误

转载 作者:搜寻专家 更新时间:2023-10-31 23:36:40 25 4
gpt4 key购买 nike

我在 Win 7 上使用 VS 2017 和 .NET Core 2。尝试使用 these instructions 在 .NET Core 2.0 和 Angular 中创建一个新的应用程序.

运行最新版本的 Node 和 npm :

node -v > v10.1.0
npm -v > v6.0.1

根据说明,我继续构建应用程序并获得

找不到 Python

我检查了路径中有 python 的环境变量。不确定为什么找不到它。

构建似乎“成功了一半”,并且对一些依赖项进行了排序。第二次构建应用程序给了我一个 JavaScript 运行时错误。我认为这是由于糟糕的第一次构建工作。

我还尝试在 ClientApp 文件夹中运行“npm install”,但出现了同样的错误,找不到 python

如有任何帮助,我们将不胜感激!

构建日志

1>------ Build started: Project: TestApp, Configuration: Debug Any CPU ------
1>TestApp -> C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\bin\Debug\netcoreapp2.0\TestApp.dll
1>v10.1.0
1>Restoring dependencies using 'npm'. This may take several minutes...
1>
1>> uws@9.14.0 install C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\uws
1>> node-gyp rebuild > build_log.txt 2>&1 || exit 0
1>
1>
1>> node-sass@4.7.2 install C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-sass
1>> node scripts/install.js
1>
1>Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/win32-x64-64_binding.node
1>Cannot download "https://github.com/sass/node-sass/releases/download/v4.7.2/win32-x64-64_binding.node":
1>
1>HTTP error 404 Not Found
1>
1>Hint: If github.com is not accessible in your location
1> try setting a proxy via HTTP_PROXY, e.g.
1>
1> export HTTP_PROXY=http://example.com:1234
1>
1>or configure npm proxy via
1>
1> npm config set proxy http://example.com:8080
1>
1>> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
1>> node lib/post_install.js
1>
1>
1>> node-sass@4.7.2 postinstall C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-sass
1>> node scripts/build.js
1>
1>Building: C:\Program Files\nodejs\node.exe C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
1>gyp info it worked if it ends with ok
1>gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
1>gyp verb cli 'C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\node-gyp\\bin\\node-gyp.js',
1>gyp verb cli 'rebuild',
1>gyp verb cli '--verbose',
1>gyp verb cli '--libsass_ext=',
1>gyp verb cli '--libsass_cflags=',
1>gyp verb cli '--libsass_ldflags=',
1>gyp verb cli '--libsass_library=' ]
1>gyp info using node-gyp@3.6.2
1>gyp info using node@10.1.0 | win32 | x64
1>gyp verb command rebuild []
1>gyp verb command clean []
1>gyp verb clean removing "build" directory
1>gyp verb command configure []

开始失败......

1>gyp verb check python checking for Python executable "python2" in the PATH
1>EXEC : gyp verb `which` failed error : not found: python2
1>gyp verb `which` failed at getNotFoundError (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:13:12)
1>gyp verb `which` failed at F (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:68:19)
1>gyp verb `which` failed at E (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:80:29)
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:89:16
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\index.js:42:5
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\windows.js:36:5
1>gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:165:21)
1>EXEC : gyp verb `which` failed python2 { error : not found: python2
1>gyp verb `which` failed at getNotFoundError (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:13:12)
1>gyp verb `which` failed at F (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:68:19)
1>gyp verb `which` failed at E (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:80:29)
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:89:16
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\index.js:42:5
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\windows.js:36:5
1>gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:165:21)
1>gyp verb `which` failed stack: 'Error: not found: python2\n at getNotFoundError (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:13:12)\n at F (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:68:19)\n at E (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:80:29)\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:89:16\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\isexe\\index.js:42:5\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\isexe\\windows.js:36:5\n at FSReqWrap.oncomplete (fs.js:165:21)',
1>gyp verb `which` failed code: 'ENOENT' }
1>gyp verb check python checking for Python executable "python" in the PATH
1>EXEC : gyp verb `which` failed error : not found: python
1>gyp verb `which` failed at getNotFoundError (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:13:12)
1>gyp verb `which` failed at F (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:68:19)
1>gyp verb `which` failed at E (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:80:29)
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:89:16
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\index.js:42:5
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\windows.js:36:5
1>gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:165:21)
1>EXEC : gyp verb `which` failed python { error : not found: python
1>gyp verb `which` failed at getNotFoundError (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:13:12)
1>gyp verb `which` failed at F (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:68:19)
1>gyp verb `which` failed at E (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:80:29)
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\which\which.js:89:16
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\index.js:42:5
1>gyp verb `which` failed at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\isexe\windows.js:36:5
1>gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:165:21)
1>gyp verb `which` failed stack: 'Error: not found: python\n at getNotFoundError (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:13:12)\n at F (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:68:19)\n at E (C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:80:29)\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\which\\which.js:89:16\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\isexe\\index.js:42:5\n at C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\isexe\\windows.js:36:5\n at FSReqWrap.oncomplete (fs.js:165:21)',
1>gyp verb `which` failed code: 'ENOENT' }
1>gyp verb could not find "python". checking python launcher
1>gyp verb could not find "python". guessing location
1>gyp verb ensuring that file exists: C:\Python27\python.exe
1>gyp ERR! configure error
1>EXEC : gyp ERR! stack error : Can't find Python executable "python", you can set the PYTHON env variable.
1>gyp ERR! stack at PythonFinder.failNoPython (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-gyp\lib\configure.js:483:19)
1>gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-gyp\lib\configure.js:508:16)
1>gyp ERR! stack at C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\graceful-fs\polyfills.js:284:29
1>gyp ERR! stack at FSReqWrap.oncomplete (fs.js:165:21)
1>gyp ERR! System Windows_NT 6.1.7601
1>gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mohammadrauf\\Desktop\\Angular_Projects\\TestApp\\ClientApp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
1>gyp ERR! cwd C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\node-sass
1>gyp ERR! node -v v10.1.0
1>gyp ERR! node-gyp -v v3.6.2
1>gyp ERR! not ok
1>EXEC : Build failed with error code: 1
1>npm WARN rollback Rolling back y18n@3.2.1 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\mohammadrauf\Desktop\Angular_Projects\TestApp\ClientApp\node_modules\yargs\node_modules'
1>npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules\node-sass):
1>npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 postinstall: `node scripts/build.js`
1>npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
1>
1>added 1218 packages from 1231 contributors in 93.516s
1>[!] 33 vulnerabilities found [6676 packages audited]
1> Severity: 3 Low | 21 Moderate | 9 High
1> Run `npm audit` for more detail

最佳答案

node-gyp 依赖于 Python2.xInstall Python in your system .

here 中检查所需的依赖项

关于python - .NET Core 2.0 和 Angular 初始应用程序构建失败 - 找不到 python 后跟 JavaScript 运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50486628/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com