Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown if "scripts" property missing from package.json #89

Closed
gunnx opened this issue Jan 14, 2017 · 1 comment
Closed

Error thrown if "scripts" property missing from package.json #89

gunnx opened this issue Jan 14, 2017 · 1 comment

Comments

@gunnx
Copy link
Collaborator

gunnx commented Jan 14, 2017

  • p-s version: 3.0.3
  • node version: 7.4.0
  • npm version: 4.0.5

Scripts file (or at least the relevant bits):

/p-s/dist/bin-utils/initialize/index.js

The command executed:

./node_modules/.bin/p-s- init

The output:

./node_modules/p-s/dist/bin-utils/initialize/index.js:31
   test: scripts.test ? 'nps test' : undefined
                 ^

TypeError: Cannot read property 'test' of undefined

Problem description:
Init fails to work if there is no "scripts" object in package.json

Suggested solution:
Inform user of problem or create "scripts" property automatically.

@kentcdodds
Copy link
Collaborator

Yeah, let's create the scripts automatically. Want to make a pull request?

kentcdodds pushed a commit that referenced this issue Feb 8, 2017
**What**: Closes #89

**Why**: Because we want to be able to init even if you have no
`scripts` in your `package.json`

**How**: ES6 magic
kentcdodds pushed a commit that referenced this issue Feb 9, 2017
**What**: Closes #89

**Why**: Because we want to be able to init even if you have no
`scripts` in your `package.json`

**How**: ES6 magic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants