ItalyPaleAle / hereditas

A static site generator for a fully trustless digital legacy box
Other
201 stars 6 forks source link

Error at installation following guide #14

Closed kalak-sudo closed 4 years ago

kalak-sudo commented 4 years ago

Hi!

I am trying to intall Hereditas but I can't. I have tried it on Mac and Ubuntu 18.04, both with node v10.17.0.

The error I always get is the following after typing "npm install --global hereditas". What I am doing wrong? Or how can I get it to work?

Thanks in advanced.



npm WARN deprecated superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
/usr/bin/hereditas -> /usr/lib/node_modules/hereditas/bin/run

> node-sass@4.13.0 install /usr/lib/node_modules/hereditas/node_modules/node-sass
> node scripts/install.js

Unable to save binary /usr/lib/node_modules/hereditas/node_modules/node-sass/vendor/linux-x64-64 : { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/hereditas/node_modules/node-sass/vendor'
    at Object.mkdirSync (fs.js:757:3)
    at sync (/usr/lib/node_modules/hereditas/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/lib/node_modules/hereditas/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/usr/lib/node_modules/hereditas/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/usr/lib/node_modules/hereditas/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path:
   '/usr/lib/node_modules/hereditas/node_modules/node-sass/vendor' }

> node-sass@4.13.0 postinstall /usr/lib/node_modules/hereditas/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /usr/lib/node_modules/hereditas/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 [ '/usr/bin/node',
gyp verb cli   '/usr/lib/node_modules/hereditas/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.8.0
gyp info using node@10.17.0 | linux | 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` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.15
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.17.0
gyp verb command install [ '10.17.0' ]
gyp verb install input version string "10.17.0"
gyp verb install installing version: 10.17.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.17.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/hereditas/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '--node_gyp_internal_noretry', '10.17.0' ]
gyp verb install input version string "10.17.0"
gyp verb install installing version: 10.17.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.17.0
gyp verb ensuring nodedir is created /usr/lib/node_modules/hereditas/node_modules/node-sass/.node-gyp/10.17.0
gyp WARN install got an error, rolling back install
gyp verb command remove [ '10.17.0' ]
gyp verb remove using node-gyp dir: /usr/lib/node_modules/hereditas/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 10.17.0
gyp verb remove removing development files for version: 10.17.0
gyp WARN install got an error, rolling back install
gyp verb command remove [ '10.17.0' ]
gyp verb remove using node-gyp dir: /usr/lib/node_modules/hereditas/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 10.17.0
gyp verb remove removing development files for version: 10.17.0
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/hereditas/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/hereditas/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/lib/node_modules/hereditas/node_modules/node-sass
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/hereditas/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.13.0 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!     /root/.npm/_logs/2019-10-28T14_09_51_905Z-debug.log
ItalyPaleAle commented 4 years ago

Looks like you installed Node.js in a way that requires root permissions to install global NPM packages. So, just like your username, you need to prefix the command with sudo :)

(You might want to re-install Node.js in a way that it doesn’t require doing this - for example using NVM)

kalak-sudo commented 4 years ago

I have tried again the way you said, with NVM and got this in the log:


21372 info lifecycle node-sass@4.13.0~postinstall: node-sass@4.13.0
21373 verbose lifecycle node-sass@4.13.0~postinstall: unsafe-perm in lifecycle false
21374 verbose lifecycle node-sass@4.13.0~postinstall: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/hereditas/node_modules/node-sass/node_modules/.bin:/usr/lib/node_modules/hereditas/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
21375 verbose lifecycle node-sass@4.13.0~postinstall: CWD: /usr/lib/node_modules/hereditas/node_modules/node-sass
21376 silly lifecycle node-sass@4.13.0~postinstall: Args: [ '-c', 'node scripts/build.js' ]
21377 silly lifecycle node-sass@4.13.0~postinstall: Returned: code: 1  signal: null
21378 info lifecycle node-sass@4.13.0~postinstall: Failed to exec postinstall script
21379 timing action:postinstall Completed in 1017ms
21380 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
21381 timing stage:rollbackFailedOptional Completed in 1570ms
21382 timing stage:runTopLevelLifecycles Completed in 25207ms
21383 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/hereditas/node_modules/fsevents):
21384 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
21385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
21385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
21385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
21385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
21386 verbose stack Error: node-sass@4.13.0 postinstall: `node scripts/build.js`
21386 verbose stack Exit status 1
21386 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
21386 verbose stack     at EventEmitter.emit (events.js:198:13)
21386 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
21386 verbose stack     at ChildProcess.emit (events.js:198:13)
21386 verbose stack     at maybeClose (internal/child_process.js:982:16)
21386 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
21387 verbose pkgid node-sass@4.13.0
21388 verbose cwd /root
21389 verbose Linux 4.15.0-20-generic
21390 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--global" "hereditas"
21391 verbose node v10.17.0
21392 verbose npm  v6.11.3
21393 error code ELIFECYCLE
21394 error errno 1
21395 error node-sass@4.13.0 postinstall: `node scripts/build.js`
21395 error Exit status 1
21396 error Failed at the node-sass@4.13.0 postinstall script.
21396 error This is probably not a problem with npm. There is likely additional logging output above.
21397 verbose exit [ 1, true ]
kalak-sudo commented 4 years ago

Looks that is something at the "postinstall"

ItalyPaleAle commented 4 years ago

What version of Node.js are you using through NVM?

I'll look into this in the evening

kalak-sudo commented 4 years ago

node v10.17.0 npm v6.11.3

Ok, thanks!!

ItalyPaleAle commented 4 years ago

I can't repro this :( Using Node.js 12 or 10 on macOS (Catalina), the installation succeedes for me:

~ nvm use 10
Now using node v10.17.0 (npm v6.11.3)
 ~ npm install --global hereditas
npm WARN deprecated superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
/Users/alessandro/.nvm/versions/node/v10.17.0/bin/hereditas -> /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/bin/run

> fsevents@1.2.9 install /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> node-sass@4.13.0 install /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/darwin-x64-64_binding.node
Download complete░░⸩ ⠋ :
Binary saved to /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Caching binary to /Users/alessandro/.npm/node-sass/4.13.0/darwin-x64-64_binding.node

> node-sass@4.13.0 postinstall /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/alessandro/.nvm/versions/node/v10.17.0/lib/node_modules/hereditas/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine
+ hereditas@0.1.1
added 813 packages from 444 contributors in 48.347s
ItalyPaleAle commented 4 years ago

Closed for inactivity