-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Sheabang should be added at first line of file: ./bin/launch_local_dynamo.js
#!/usr/bin/env nodeSteps to reproduce error:
mkdir test-local-dynamo
cd test-local-dynamo
npm init -y
npm install local-dynamo -S
# next command edit script "test" in package.json to start local-dynamo
sed -i '' -e 's/"test": ".*"[^"]*$/"test": "local-dynamo --port=8000"/' package.json
npm testlast command produces error:
./node_modules/.bin/local-dynamo: line 1: //: is a directory
./node_modules/.bin/local-dynamo: line 3: /Applications: is a directory
./node_modules/.bin/local-dynamo: line 4: node_modules: command not found
./node_modules/.bin/local-dynamo: line 5: node_modules/: is a directory
./node_modules/.bin/local-dynamo: line 7: syntax error near unexpected token `('
./node_modules/.bin/local-dynamo: line 7: `var flags = require('flags')'
npm ERR! Test failed. See above for more details.
Workaround:
add under "scripts" in package.json entry:
"postinstall": "perl -i -pe '$.==1&&s%^%#!/usr/bin/env node\\n%' node_modules/local-dynamo/bin/launch_local_dynamo.js",manually or by command:
perl -i -pe 's@^(.*"scripts": {)(.*)$@$1\n "postinstall": "perl -i -pe '"'\\$.==1&&s%^%#\!\/usr\/bin\/env node\\\\\\\\n%'"' node_modules\/local-dynamo\/bin\/launch_local_dynamo.js",$2@' package.jsonreinstall packages: npm ci
and run database: npm test
moravcik
Metadata
Metadata
Assignees
Labels
No labels