Closed arielfernando closed 8 years ago
Can you post the error you are seeing?
On Tue, Sep 1, 2015, 07:02 arielfernando notifications@github.com wrote:
The npm script only install this module if you are root. With another system user you have an error.
— Reply to this email directly or view it on GitHub https://github.com/eonarheim/TypeState/issues/6.
/src$ npm install typestate \
typestate@1.0.0 preinstall /home/afa/src/node_modules/typestate npm i -g typescript@1.0.0
npm ERR! tar.unpack untar error /home/afa/.npm/typescript/1.0.0/package.tgz npm ERR! Linux 3.13.0-61-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "-g" "typescript@1.0.0" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! path /usr/lib/node_modules/typescript npm ERR! code EACCES npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/typescript' npm ERR! at Error (native) npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/typescript'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! path: '/usr/lib/node_modules/typescript', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/usr/lib/node_modules/typescript', npm ERR! fstream_class: 'DirWriter', npm ERR! fstream_stack: npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25', npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53', npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request: npm ERR! /home/afa/src/node_modules/typestate/npm-debug.log npm ERR! Linux 3.13.0-61-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "typestate" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code ELIFECYCLE
npm ERR! typestate@1.0.0 preinstall: npm i -g typescript@1.0.0
npm ERR! Exit status 243
npm ERR!
npm ERR! Failed at the typestate@1.0.0 preinstall script 'npm i -g typescript@1.0.0'.
npm ERR! This is most likely a problem with the typestate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm i -g typescript@1.0.0
npm ERR! You can get their info via:
npm ERR! npm owner ls typestate
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/afa/src/npm-debug.log
According to NPM docs:
Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.
So just sudo the npm install typescript global command (or sudo the typestate install).
That said, maybe the package.json can actually support having globally installed dependencies (or it can just have a devDependency of typescript).
I don't think you need TS installed globally unless you plan to compile TypeState, right @eonarheim? In that case, specifying it as a dev dependency is probably better.
Furthermore, ariel you could install this via bower if you plan to actually use it in an app since it's easier... npm is really only for developing/extending TypeState. @eonarheim maybe readme can be updated to only show bower install and remove from npm... then also just add the minified/non-min and declaration file to the Release in GH.
I've found Typestate really useful and greatly appreciate the work that went into it. That being said I was hoping the author would publish the latest to NPM to avoid the preinstall script issue.
Ray, are you using this in a Node.js app or a browser app? Just curious.
On Mon, Jan 25, 2016, 05:21 Ray Martone notifications@github.com wrote:
I've found Typestate really useful and greatly appreciate the work that went into it. That being said I was hoping the author would publish the latest to NPM to avoid the preinstall script issue.
— Reply to this email directly or view it on GitHub https://github.com/eonarheim/TypeState/issues/6#issuecomment-174476861.
Hi @rmartone! I'm glad you enjoyed using Typestate!
The new npm package totally slipped my mind, thanks for the reminder. I'll try to get this published sooner than later.
@rmartone I've published the new version to all package repos! Let me know if you come across any issues.
Although I use typestate on the client only, my app has both client and server parts so using commonjs and npm. This is mostly about preference. Nevertheless, I've installed bower to avoid the issue for now, but wouldn't need it otherwise. As far as I can tell, simply publishing the latest typestate package.json to npm would solve my problem.
LOL - just read down. Thanks will give it a try.
The npm script only install this module if you are root. With another system user you have an error.