Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

npm install semantic-ui --save error

Open Dreampie opened this issue 9 years ago • 12 comments

npm WARN excluding symbolic link tests/withsymlinks/.hidden -> ../shown/.hidden
npm WARN excluding symbolic link tests/withsymlinks/bar.txt -> ../shown/bar.txt
[11:51:10] Starting 'run setup'...
? Set-up Semantic UI Automatic (Use defaults locations and all components)
?     
    We detected you are using NPM. Nice!  
    
    Is this your project folder?
    /Users/dd/IdeaProjects/management/view 
    
 
 (Use arrow keys)
  Yes 
  No, let me specify 

readline.js:991
            throw err;
            ^

TypeError: Cannot read property 'name' of undefined
    at Prompt.render (/Users/dd/IdeaProjects/management/view/node_modules/inquirer/lib/prompts/list.js:95:69)
    at Prompt.onSubmit (/Users/dd/IdeaProjects/management/view/node_modules/inquirer/lib/prompts/list.js:116:8)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver.tryCatcher (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:63:31)
    at AutoDetachObserverPrototype.next (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:5782:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:1469:31)
    at AnonymousObserver._onNext (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:4234:13)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:1535:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/dd/IdeaProjects/management/view/node_modules/rx-lite/rx.lite.js:1469:31)
⸨               ░░░⸩ ⠦ install: info lifecycle [email protected]~install: Failed to exec install script


npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node/7.4.0/bin/node" "/usr/local/bin/npm" "install" "semantic-ui" "--save"
npm ERR! node v7.4.0

Dreampie avatar Jan 26 '17 04:01 Dreampie

Did you press the arrow key to select Yes or No? I think there is no option selected by default for some reason...

dom-kelly avatar Jan 26 '17 09:01 dom-kelly

@Dreampie have you figured it out?

awgv avatar Feb 04 '17 09:02 awgv

no, I download dist js file,maybe you can set default value to selected,thanks

Dreampie avatar Feb 04 '17 09:02 Dreampie

@Dreampie, I have had the same problem, and found that pressing the arrow key to select Yes or No will make the error disappear, as @dominicjameskelly said.

tarvos21 avatar Feb 05 '17 05:02 tarvos21

@tarvos21 is right, the issue seems to happen when the user doesn't manually select an answer.

To fix the issue alone we could just add default: true, to https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/config/project/install.js#L291 But unfortunately, I was looking at the other choice questions as well and they all seem to not have a default option.

IonutBajescu avatar Feb 19 '17 13:02 IonutBajescu

Same error here. First two times selecting via arrows did not cause any reactions, until eventually the installation process died by its own. On third try everything went smooth, I didn't make any changes in the meantime ... magic :smile: :star:

Maddoc42 avatar Feb 22 '17 17:02 Maddoc42

Has anyone checked and confirmed adding default value fixes the issue, or is this something I need to still verify?

jlukic avatar Feb 22 '17 17:02 jlukic

Hi, @jlukic, I myself encounter this problem when trying to npm install semantic-ui --save in an empty directory, or any project directory, without any tasks/ directory or *.json files.

When it asks for project direcotry: 22-1

The error will appear when I press 'Enter' like the previous step, but actually I need to use arrow keys to choose yes or no, it's not so obvious for a really new user, who probably is used to directly just hit 'Enter' several times and everything is done. I think this may be a problem for really new users of Semantic-UI.

tarvos21 avatar Feb 23 '17 02:02 tarvos21

@jlukic sorry, no - I was wrong. It looks like the problem wasn't that we were not specifying a default choice but that the default option that we were specifying was wrong, see https://github.com/SBoudrias/Inquirer.js/issues/203.

The default used to be the project root, /home/ionut/PhpstormProjects/ui in my case, whereas the choice values are true and false. Just removing that default seems to have fixed it, as Inquirer always selects by default the first choice.

Made a PR with instructions on how to test it here: https://github.com/Semantic-Org/Semantic-UI/pull/5070.

IonutBajescu avatar Feb 23 '17 11:02 IonutBajescu

Similar with npm init i like to hit Enter several times when init/install something or use the -y option, but when install semantic-ui, I hit Enter several times and I met the above mentioned error, google pointed me to this page, hope that the installation process could me more smooth. Thanks.

uniquejava avatar Apr 14 '17 06:04 uniquejava

With "npm install semantic-ui --save", I had the same problem. but once using -y option (npm install semantic-ui -y --save), the problem was solved.

spa46 avatar Jul 22 '17 12:07 spa46

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 23 '18 09:02 stale[bot]