# DoneJS Error: add component

**URL:** <https://forums.bitovi.com/t/donejs-error-add-component/145>\
**Category:** DoneJS\
**Created:** [February 6, 2016, 5:52pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145 "2016-02-06T17:52:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 5:52pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/1 "2016-02-06T17:52:35Z")

</div>

Starting from Scratch, I installed the following on Windows 7 Home Premium:

- Node - v0.12.9
- Npm - 2.14.9
- Chocolatey
- Python 2.7.11
- Windows SDK 7.1
- Visual Studio Express 2014 Desktop

Then rand the following a the command prompt:

npm install -g donejs  
npm init donejs-chat  
npm install bootstrap --save

All of the above ran just fine w/o any errors…

When I get to the following section of the Quick Start Guide:

[http://donejs.com/Guide.html#section=section\_Generatecustomelements](http://donejs.com/Guide.html#section=section_Generatecustomelements)

I get the following error when trying to add a component:

C:\_\_source\donejs\donejs-chat\>donejs add component home.component chat-home  
x No ‘folder’ or ‘appName’ specified. Neither in your .yo-rc.json nor in your package.json file

Not sure what needs to be done to remedy the issue…

Any assistance is greatly appreciated!!

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:04pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/2 "2016-02-06T18:04:34Z")

</div>

Is there a .yo-rc.json? Can you show the contents here?

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:07pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/3 "2016-02-06T18:07:30Z")

</div>

.yo-rc-json does not exist…

The following is the list of files in the project folder:

.gitignore  
build.js  
development.html  
documentjs.json  
node\_modules  
package.json  
production.html  
readme.md

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:10pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/4 "2016-02-06T18:10:45Z")

</div>

The following is the src contents:

C:\_\_SOURCE\DONEJS\DONEJS-CHAT\SRC  
| app.js  
| [index.md](http://index.md)  
| index.stache  
| styles.less  
| test.html  
|  
±–models  
| | test.js  
| |  
| —fixtures  
| fixtures.js  
|  
—test  
functional.js  
test.js

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:14pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/5 "2016-02-06T18:14:45Z")

</div>

I’ll take a look at it in about 30 min. My guess is that it was caused by [https://github.com/donejs/generator-donejs/commit/cc003434fe49e2727823b374b44e7a63f05c0569](https://github.com/donejs/generator-donejs/commit/cc003434fe49e2727823b374b44e7a63f05c0569)

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:19pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/6 "2016-02-06T18:19:33Z")

</div>

Actually, that version would produce a different error. Can you run an ‘npm cache clean’ and try ‘donejs init’ again?

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:25pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/7 "2016-02-06T18:25:50Z")

</div>

Well… It didn’t like that cache clean…

## C:\_\_source\donejs\>donejs init donejs-chat Initializing new DoneJS application at C:\_\_source\donejs\donejs-chat Installing donejs-cli

> spawn-sync@1.0.15 postinstall C:\_\_source\donejs\donejs-chat\node\_modules\donejs-cli\node\_modules\yeoman-gene  
> rator\node\_modules\cross-spawn\node\_modules\spawn-sync  
> node postinstall

npm ERR! Windows\_NT 6.1.7601  
npm ERR! argv “C:\Program Files\nodejs\\node.exe” “C:\Program Files\nodejs\node\_modules\npm\bin\npm-cl  
i.js” “install” “donejs-cli@^0.6.0” “–loglevel” “error”  
npm ERR! node v0.12.9  
npm ERR! npm v2.14.9  
npm ERR! path C:\Users\TheGriz\AppData\Roaming\npm-cache\xtend\4.0.1\package\package.json  
npm ERR! code EPERM  
npm ERR! errno -4048

npm ERR! Error: EPERM, rename ‘C:\Users\TheGriz\AppData\Roaming\npm-cache\xtend\4.0.1\package\package.json’  
npm ERR! at Error (native)  
npm ERR! { [Error: EPERM, rename ‘C:\Users\TheGriz\AppData\Roaming\npm-cache\xtend\4.0.1\package\package.json’]

npm ERR! errno: -4048,  
npm ERR! code: ‘EPERM’,  
npm ERR! path: ‘C:\Users\TheGriz\AppData\Roaming\npm-cache\xtend\4.0.1\package\package.json’,  
npm ERR! parent: ‘through2’ }  
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! C:\_\_source\donejs\donejs-chat\npm-debug.log  
Error: Command `npm` did not complete successfully  
at ChildProcess. (C:\Users\TheGriz\AppData\Roaming\npm\node\_modules\donejs\lib\utils.js:45:23)  
at ChildProcess.emit (events.js:110:17)  
at ChildProcess.cp.emit (C:\Users\TheGriz\AppData\Roaming\npm\node\_modules\donejs\node\_modules\cross-spawn-a  
sync\lib\enoent.js:37:29)  
at Process.ChildProcess.\_handle.onexit (child\_process.js:1075:12)

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:34pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/8 "2016-02-06T18:34:38Z")

</div>

Just to make sure, you removed the old app before re-initing?

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:39pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/9 "2016-02-06T18:39:10Z")

</div>

I renamed the original folder to donejs-chat,bak before running the cache clean & init commands.

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:43pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/10 "2016-02-06T18:43:11Z")

</div>

I uninstalled/reinstalled Node…  
Removed all existing project folders…  
Then installed DoneJs…

During donejs init donejs-chat, it display the following files:

C:\_\_source\donejs\donejs-chat  
└── generator-donejs@0.6.3

? Project name donejs-chat  
? Project main folder src  
? Description  
? Project homepage url  
? GitHub username or organization  
? Author’s Name  
? Author’s Email  
? Author’s Homepage  
? Application keywords  
? NPM version used 3  
Writing package.json v0.6.5  
create package.json  
create [readme.md](http://readme.md)  
create documentjs.json  
create .gitignore  
create build.js  
create production.html  
create development.html  
create src\test.html  
create src\app.js  
create src\index.stache  
create src\[index.md](http://index.md)  
create src\styles.less  
create src\test\test.js  
create src\test\functional.js  
create src\models\fixtures\fixtures.js  
create src\models\test.js

Looks like the YO file is still missing…

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:46pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/11 "2016-02-06T18:46:11Z")

</div>

YO doesn’t need to exist in latest.

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:46pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/12 "2016-02-06T18:46:16Z")

</div>

I think I have a work around…

Downloaded from Git: place-my-order

Copied the ,yo-rc.json file from the downloaded project over to donejs-chat.  
Then updated it with the following content:

{  
“generator-donejs”: {  
“folder”: “src”,  
“name”: “donejs-chat”  
}  
}

Afterwards, I was able to run the add component command successfully.

C:\_\_source\donejs\donejs-chat\>donejs add component home.component chat-home  
create src\home.component

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:48pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/13 "2016-02-06T18:48:26Z")

</div>

How can I check/retrieve the latest generator version?

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:48pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/14 "2016-02-06T18:48:50Z")

</div>

Verified `donejs add component` works:

- on my mac
- with `npm cache clean`
- with no `yo-rc`.

Will try my win 10 machine next.

---

<div class="post-metadata">

**Author:** ![TNBassWebmaster](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@TNBassWebmaster](https://forums.bitovi.com/u/TNBassWebmaster)\
**Post date:** [February 6, 2016, 6:51pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/15 "2016-02-06T18:51:32Z")

</div>

Thanks for the assistance today!!  
Nothing like working on a Saturday…

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 6:51pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/16 "2016-02-06T18:51:40Z")

</div>

`donejs init` should always install the latest version of everything compatible with the getting started guides. Depeding on your version of NPM, how it’s configured, sometimes it uses a cached version, so it won’t install latest. However, a `npm cache clean` should always fix that.

So to be confident of getting the latest of everything you should just have to do:

```
npm cache clean
donejs install -g donejs
donejs init

```

But really, `donejs init` is all you really should have to do.

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 7:20pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/17 "2016-02-06T19:20:49Z")

</div>

when you ran `donejs init` did you run it as admin? I am seeing permission errors. Might want to try running it as an administrator.

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [February 6, 2016, 7:39pm UTC](https://forums.bitovi.com/t/donejs-error-add-component/145/18 "2016-02-06T19:39:32Z")

</div>

verified that:

- node 0.12.9
- on win 10

works. I didn’t have to run the administrator console, but if you see permission errors again, I’d try it out.
