Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core 2.0 & Angular Initial app build fails - Can't find python followed by JavaScript Runtime Error

I am on VS 2017 and .NET Core 2 on Win 7. Tried creating a fresh app in .NET Core 2.0 and Angular using these instructions.

Running latest versions of node and npm :

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

According to the instructions, I went ahead to build the application and got

Can't find Python

I checked env variables the path has python. Not sure why it can't find it.

The build seems to have "half worked" and got some dependencies sorted. The second go around building the app gave me a JavaScript Runtime Error .. which I think is due to crappy first build job.

I also tried running "npm install" in the ClientApp folder and gave the same errors, Can't find python.

Any help would be appreciated !

Build Log

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>> [email protected] 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>> [email protected] 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>> [email protected] 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>> [email protected] 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 [email protected]
1>gyp info using [email protected] | win32 | x64
1>gyp verb command rebuild []
1>gyp verb command clean []
1>gyp verb clean removing "build" directory
1>gyp verb command configure []

Starts to fail ...

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 [email protected] 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: [email protected] (node_modules\node-sass):
1>npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 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
like image 249
MAR Avatar asked May 23 '18 10:05

MAR


People also ask

Is .NET 2.0 still supported?

NET Framework 2.0 has been around for a decade but will be completely unsupported by Microsoft; the announced end of the extended support period is April 12, 2016. In lock-step with the . NET Framework, the corresponding version of Microsoft's development tool, Visual Studio 2005, is also at its end-of-life.

Is .NET Core 2.1 still supported?

NET Core 2.1 is no longer supported and updates will no longer be provided. If your application uses NET Core 2.1, we strongly recommend you migrate your application to a supported version – . NET 3.1 or later. You can download these versions from the .

Is .NET Core outdated?

NET framework is highly outdated. Of course, the main reason behind this is the lack of cross-platform development, which was rectified in future versions released by Microsoft. Most developers and programmers prefer programming languages and frameworks that offer flexibility when working with them.


1 Answers

node-gyp has dependency on Python2.x. Install Python in your system.

Checkout the required dependency from here

like image 179
Ritwick Dey Avatar answered Oct 07 '22 02:10

Ritwick Dey