treehouse-projects / photoblog

Angular Basics sample app
2 stars 7 forks source link

Installation error #1

Open sa9 opened 7 years ago

sa9 commented 7 years ago

Hello,

I downloaded the zip file (https://s3.amazonaws.com/treehouse-project-downloads/Angular2017/photo_blog.zip) and ran npm install but it shows the following error:

""" fsevents@1.1.1 install /temp/photo_blog/node_modules/fsevents

node install

[fsevents] Success: "/temp/photo_blog/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile

photoblog@ postinstall /temp/photo_blog npm run build

photoblog@ build /temp/photo_blog webpack

/temp/photo_blog/config/common.config.js:13 return path.join.apply(path, [ROOT, ...pathParts]); ^^^

SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:413:25) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/temp/photo_blog/config/release.config.js:5:22) at Module._compile (module.js:434:26) at Object.Module._extensions..js (module.js:452:10) """ Any suggestions?

chalkers commented 7 years ago

Did you try npm install --update-binary or npm install --build-from-source

chalkers commented 7 years ago

Are you still having the issue @sa9?

slegaitis commented 7 years ago

I'm having same issue. npm install --build-from-source or npm install --update-binary did not help

njmont commented 7 years ago

I have changed the code in config/common.config.js to this, which appears to have fixed the issue. It appears the spread operator wasn't working for me.


function root(pathParts) {
  if (typeof pathParts === 'string') {
    pathParts = pathParts.split('/');
  }
  var arr = [ROOT].concat(pathParts);
  return path.join.apply(path, arr);
}
chalkers commented 7 years ago

Ahhh what version of node are you using?

mkempinsky commented 7 years ago

I am having similar issues, I keep getting these errors when trying to run 'npm install'. I tried above solutions with no success. screen shot 2017-06-07 at 2 39 57 pm

mkempinsky commented 7 years ago

Hmm I was able to get it working by starting from scratch, not sure what the issue was. I also updated my version of node, maybe that was it?

KenStoneBlue commented 7 years ago

Updating node to v6.11 fixed it.

I'm on Ubuntu 16.04 and I think there is some issue with apt-get and node which is why I had the older version.

node version: v4.2.6

same issue here: ` /config/common.config.js:13 return path.join.apply(path, [ROOT, ...pathParts]); ^^^

SyntaxError: Unexpected token ... `