training4developers / mastering-angular-starter

Starter Files for the Mastering Angular Series on WintellectNOW
https://www.wintellectnow.com/Home/SeriesDetail?seriesId=mastering-angular
MIT License
22 stars 21 forks source link

Error while installing npm modules #5

Open JayashreeWadekar opened 6 years ago

JayashreeWadekar commented 6 years ago

I am getting following errors. I tried deleting nmp_modules folder and re-installing as per instructions. But it's not working. I am not able to start the application, it says

2017-11-24T00_21_33_157Z-debug.log

Please get back at the earliest.

ericwgreene commented 6 years ago

You will need to use Node.js 7. Node.js 8 may work, but the problem you appear to be running into is compilation issue with node-sass.

I did try it with Node.js 9.0.0 and it worked fine. Do you have a C++ compiler and Python 2.7 installed? NPM will require that to compile node-sass for the version of Node.js you are using.

I just did an install of 9.2.0 and a rebuild of my 9.0.0 package install and all worked great.

I would either downgrade to Node.js 7 or 8 or install C++ with Python 2.7 so node-sass can be built locally (like it did on mine). Thanks!

JayashreeWadekar commented 6 years ago

Thank you for the response. Upper version of nodejs should ideally work. What shall I have to do to resolve compilation problem with node-sass.

Regards, Jayashree

On Nov 24, 2017 6:36 PM, "Eric W. Greene" notifications@github.com wrote:

You will need to use Node.js 7. Node.js 8 may work, but the problem you appear to be running into is compilation issue with node-sass.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/training4developers/mastering-angular-starter/issues/5#issuecomment-346824883, or mute the thread https://github.com/notifications/unsubscribe-auth/AgXx83GnrXj7MfWdjjUgweiaQr-bWOwvks5s5r9ygaJpZM4QpQ1B .

ericwgreene commented 6 years ago

Please log into GitHub to read my reply. I updated my original post on the issue with instructions. Thanks!

JayashreeWadekar commented 6 years ago

Hallo Eric, I started fresh with installing latest version of node js, python 2.7 and turbo c++(for c++ compiler). This time I am getting following errors. Unless I run the demo code, I won't be able to do any changes and hands on.

2017-12-13T09_19_33_888Z-debug.log

node-sass@4.5.3 install D:\mastering-angular-starter\node_modules\node-sass node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-59_binding.node Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/win32-x64-59_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

node-sass@4.5.3 postinstall D:\mastering-angular-starter\node_modules\node-sass node scripts/build.js

Building: C:\Program Files\nodejs\node.exe D:\mastering-angular-starter\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= gyp info it worked if it ends with ok gyp verb cli [ 'C:\Program Files\nodejs\node.exe', gyp verb cli 'D:\mastering-angular-starter\node_modules\node-gyp\bin\node-gyp.js', gyp verb cli 'rebuild', gyp verb cli '--verbose', gyp verb cli '--libsass_ext=', gyp verb cli '--libsass_cflags=', gyp verb cli '--libsass_ldflags=', gyp verb cli '--libsass_library=' ] gyp info using node-gyp@3.6.2 gyp info using node@9.3.0 | win32 | x64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb check python checking for Python executable "python2" in the PATH gyp verb which failed Error: not found: python2 gyp verb which failed at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29) gyp verb which failed at D:\mastering-angular-starter\node_modules\which\which.js:89:16 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:166:21) gyp verb which failed python2 { Error: not found: python2 gyp verb which failed at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29) gyp verb which failed at D:\mastering-angular-starter\node_modules\which\which.js:89:16 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:166:21) gyp verb which failed stack: 'Error: not found: python2\n at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12)\n at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19)\n at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29)\n at D:\mastering-angular-starter\node_modules\which\which.js:89:16\n at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5\n at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5\n at FSReqWrap.oncomplete (fs.js:166:21)', gyp verb which failed code: 'ENOENT' } gyp verb check python checking for Python executable "python" in the PATH gyp verb which failed Error: not found: python gyp verb which failed at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29) gyp verb which failed at D:\mastering-angular-starter\node_modules\which\which.js:89:16 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:166:21) gyp verb which failed python { Error: not found: python gyp verb which failed at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29) gyp verb which failed at D:\mastering-angular-starter\node_modules\which\which.js:89:16 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqWrap.oncomplete (fs.js:166:21) gyp verb which failed stack: 'Error: not found: python\n at getNotFoundError (D:\mastering-angular-starter\node_modules\which\which.js:13:12)\n at F (D:\mastering-angular-starter\node_modules\which\which.js:68:19)\n at E (D:\mastering-angular-starter\node_modules\which\which.js:80:29)\n at D:\mastering-angular-starter\node_modules\which\which.js:89:16\n at D:\mastering-angular-starter\node_modules\isexe\index.js:42:5\n at D:\mastering-angular-starter\node_modules\isexe\windows.js:36:5\n at FSReqWrap.oncomplete (fs.js:166:21)', gyp verb which failed code: 'ENOENT' } gyp verb could not find "python". checking python launcher gyp verb could not find "python". guessing location gyp verb ensuring that file exists: C:\Python27\python.exe gyp verb check python version C:\Python27\python.exe -c "import platform; print(platform.python_version());" returned: "2.7.13\r\n" gyp verb get node dir no --target version specified, falling back to host node version: 9.3.0 gyp verb command install [ '9.3.0' ] gyp verb install input version string "9.3.0" gyp verb install installing version: 9.3.0 gyp verb install --ensure was passed, so won't reinstall if already installed gyp verb install version is already installed, need to check "installVersion" gyp verb got "installVersion" 9 gyp verb needs "installVersion" 9 gyp verb install version is good gyp verb get node dir target node version installed: 9.3.0 gyp verb build dir attempting to create "build" dir: D:\mastering-angular-starter\node_modules\node-sass\build gyp verb build dir "build" dir needed to be created? D:\mastering-angular-starter\node_modules\node-sass\build gyp verb Not using VS2017: Could not use PowerShell to find VS2017 gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: D:\mastering-angular-starter\node_modules\node-sass\build\config.gypi gyp verb config.gypi checking for gypi file: D:\mastering-angular-starter\node_modules\node-sass\config.gypi gyp verb common.gypi checking for gypi file: D:\mastering-angular-starter\node_modules\node-sass\common.gypi gyp verb gyp gyp format was not specified; forcing "msvs" gyp info spawn C:\Python27\python.exe gyp info spawn args [ 'D:\mastering-angular-starter\node_modules\node-gyp\gyp\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=auto', gyp info spawn args '-I', gyp info spawn args 'D:\mastering-angular-starter\node_modules\node-sass\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'D:\mastering-angular-starter\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\Amar\.node-gyp\9.3.0\include\node\common.gypi',gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\Amar\.node-gyp\9.3.0', gyp info spawn args '-Dnode_gyp_dir=D:\mastering-angular-starter\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\Users\Amar\.node-gyp\9.3.0\<(target_arch)\node.lib', gyp info spawn args '-Dmodule_root_dir=D:\mastering-angular-starter\node_modules\node-sass', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'D:\mastering-angular-starter\node_modules\node-sass\build',gyp info spawn args '-Goutput_dir=.' ] gyp verb command build [] gyp verb build type Release gyp verb architecture x64 gyp verb node dev dir C:\Users\Amar.node-gyp\9.3.0 gyp verb found first Solution file build/binding.sln gyp verb could not find "msbuild.exe" in PATH - finding location in registry gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe gyp info spawn args [ 'build/binding.sln', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' ] Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Build started 12/13/2017 3:21:29 PM. MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools ver sions are "4.0".

Build FAILED.

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools v ersions are "4.0".

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.20 gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (D:\mastering-angular-starter\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:159:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\mastering-angular-starter\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd D:\mastering-angular-starter\node_modules\node-sass gyp ERR! node -v v9.3.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm WARN Error: EPERM: operation not permitted, scandir 'D:\mastering-angular-starter\node_modules\scss-tokenizer\node_modules' npm WARN { Error: EPERM: operation not permitted, scandir 'D:\mastering-angular-starter\node_modules\scss-tokenizer\node_modules' npm WARN stack: 'Error: EPERM: operation not permitted, scandir \'D:\mastering-angular-starter\node_modules\scss-tokenizer\node_modules\'', npm WARN errno: -4048, npm WARN code: 'EPERM', npm WARN syscall: 'scandir', npm WARN path: 'D:\mastering-angular-starter\node_modules\scss-tokenizer\node_modules' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@4.5.3 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@4.5.3 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Amar\AppData\Roaming\npm-cache_logs\2017-12-13T09_51_32_357Z-debug.log

ericwgreene commented 6 years ago

I am very sorry you are having problems. It looks like you are having several problems including downloading files, build tool problems, file permissions and such. These issues are something you will need to resolve with your overall system setup. If you are on Windows, the recommended C++ compiler for Node.js is Visual Studio. I recommend downloading the community edition (https://www.visualstudio.com/vs/community/) and trying that. You may need to uninstall Turbo C++ to avoid conflicts in terms of paths to the C++ compiler (between Visual Studio and Turbo C++) and such. I have not used Turbo C++ since the 1990's so I am not sure how it would interact with Node.js, the latest versions of Windows or the project.

Another option is to use the Angular CLI. You can install that and follow along with the videos too.

WeAreUSS commented 6 years ago

In my humble opinion, this whole problem should go away. I paid cash money to learn Angular 2 and what I got is a package which will not work as a demonstration example. I think the package should work with the latest releases of ALL components. Why should I have to use a backwards environment to learn something that should be new? If you can't spend the time to make your products "up-to-date" then you should not be charging for their use. I am not a happy camper as I have spent way too much time compensating for your lack of attention to this matter....

t4d-io-website commented 6 years ago

Hi WeAreUSS,

I replied privately to your direct email to me (within minutes of receiving it) with the best solution to your problem. This git repo solution was the starter project solution I used before the Angular CLI became very popular and stable. I recommend using the Angular CLI instead of this project for new projects. The videos are only valid for the current versions of the software as of the time of recording.

So, I just re-installed Node.js 6, cloned this repo, installed the packages and everything ran perfectly for me. So I am not sure what is wrong with your system, but providing technical support on your system is outside of the scope of what I can do for you. Sorry.

Also, when I immediately replied to your private, direct email to me it is not appreciated for you to chase this down in a public forum especially when the software does work. I see you are new to GitHub. GitHub is a collaborative community where developers work together to solve problems (just like I kindly attempted to do with you privately). Unfortunately, coding software is often filled with frustrations especially with JavaScript projects dependent upon NPM packages.

As I said, I just freshly downloaded the project using Node.js 6 and all worked perfectly for me the first time. I hope you are able to get this working.

Thanks, Eric