angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.97k forks source link

The Broccoli Plugin [Funnel] failed #1134

Closed aemaghrabi closed 8 years ago

aemaghrabi commented 8 years ago

Hi, guys This is my first time using angular-cli for create Angular2 applications, and when I do first serve I have got this error:

Error: EISDIR: illegal operation on a directory, symlink 'f:\Work\Upwork\Tony Capoli\test-ang-cli\src' -> 'f:\Work\Upwork\Tony Capoli\test-ang-cli\tmp\funnel-input_base_path-IGNjlrlo.tmp\0'
    at Error (native)
    at Object.fs.symlinkSync (fs.js:1048:18)
    at symlinkWindows (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\symlink-or-copy\index.js:104:18)
    at symlinkOrCopySync (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\symlink-or-copy\index.js:53:5)
    at F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\broccoli-plugin\read_compat.js:58:9
    at lib$rsvp$$internal$$tryCatch (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at: 
    at Funnel.Plugin (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\broccoli-plugin\index.js:10:31)
    at new Funnel (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\broccoli-funnel\index.js:44:10)
    at Angular2App._buildInputTree (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\lib\broccoli\angular2-app.js:84:7)
    at new Angular2App (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\lib\broccoli\angular2-app.js:51:41)
    at module.exports (F:\Work\Upwork\Tony Capoli\test-ang-cli\angular-cli-build.js:10:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:55:19)
    at Class.module.exports.Task.extend.init (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\ember-cli\lib\models\builder.js:89:10)
    at new Class (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\core-object\core-object.js:18:12)
    at Class.module.exports.Task.extend.run (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\ember-cli\lib\tasks\serve.js:15:19)
    at F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\ember-cli\lib\commands\serve.js:64:24
    at lib$rsvp$$internal$$tryCatch (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (F:\Work\Upwork\Tony Capoli\test-ang-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Note: I'm using Windows 10, NPM version is 3.9.6 and NodeJs version is 6.2.2

ketulrastogi commented 8 years ago

Try using CMD with administrator privileges.

filipesilva commented 8 years ago

If you update to beta.6 of the CLI, you shouldn't have this problem. See https://github.com/angular/angular-cli#updating-angular-cli

aemaghrabi commented 8 years ago

@filipesilva @ketulrastogi I'm still facing the same error, Also I'm running CMD as administrator and installed the last version of angular-cli.

Here 2 screenshot for build command and serve command. capture1

capture2

filipesilva commented 8 years ago

Did you fully follow the upgrade guide as per my previous comment?

aemaghrabi commented 8 years ago

Yes, @filipesilva Also tried to create new project, and the same problem happen with each project I create.

Also here a package.json file and screenshot of nodejs and angular-cli global version of the project package, nodejs version and angular-cli verstion.

{
  "name": "ang-cli",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "postinstall": "typings install",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "2.0.0-rc.1",
    "@angular/http": "2.0.0-rc.1",
    "@angular/platform-browser": "2.0.0-rc.1",
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
    "@angular/router": "3.0.0-alpha.3",
    "es6-shim": "0.35.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.26",
    "zone.js": "0.6.12"
  },
  "devDependencies": {
    "angular-cli": "1.0.0-beta.6",
    "codelyzer": "0.0.20",
    "ember-cli-inject-live-reload": "1.4.0",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "protractor": "3.3.0",
    "ts-node": "0.5.5",
    "tslint": "3.11.0",
    "typescript": "1.8.10",
    "typings": "0.8.1"
  }
}

capture3

filipesilva commented 8 years ago

This is my log from running these commands using git bash:

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox
$ ng -v
fatal: ref HEAD is not a symbolic ref
angular-cli: local (v1.0.0-beta.6, branch: ??)
node: 5.11.1
os: win32 x64

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox
$ ng new symlink-test
installing ng2
  create .editorconfig
  create README.md
  create src\app\app.component.css
  create src\app\app.component.html
  create src\app\app.component.spec.ts
  create src\app\app.component.ts
  create src\app\environment.ts
  create src\app\index.ts
  create src\app\shared\index.ts
  create src\favicon.ico
  create src\index.html
  create src\main.ts
  create src\system-config.ts
  create src\tsconfig.json
  create src\typings.d.ts
  create angular-cli-build.js
  create angular-cli.json
  create config\environment.dev.ts
  create config\environment.js
  create config\environment.prod.ts
  create config\karma-test-shim.js
  create config\karma.conf.js
  create config\protractor.conf.js
  create e2e\app.e2e-spec.ts
  create e2e\app.po.ts
  create e2e\tsconfig.json
  create e2e\typings.d.ts
  create .gitignore
  create package.json
  create public\.gitignore
  create public\.npmignore
  create tslint.json
  create typings.json
Successfully initialized git.
- Installing packages for tooling via npm
    (No dependencies)

\ Installing packages for tooling via npm
├── es6-shim (ambient)
├── angular-protractor (ambient dev)
├── jasmine (ambient dev)
└── selenium-webdriver (ambient dev)

Installed packages for tooling via npm.

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/symlink-test (master)
$ ng build

Running without elevated rights. Running Ember CLI "as Administrator" increases performance significantly.
See ember-cli.com/user-guide/#windows for details.

Built project successfully. Stored in "dist/".

I also tried running it from windows command prompt:

E:\sandbox\symlink-test>ng build

Running without elevated rights. Running Ember CLI "as Administrator" increases
performance significantly.
See ember-cli.com/user-guide/#windows for details.

Built project successfully. Stored in "dist/".

Did you do something different from what I did? This was on Windows 10.

filipesilva commented 8 years ago

There's something really weird here... you're getting a symlink error - but admin permissions should allow you to symlink.

But you're also getting a EISDIR error... meaning that something is a directory, but a file was expected (I think).

Very weird.... does f:\Work\Upwork\Tony Capoli\ have some special permissions set or something? Can you maybe give me a repo where this happens that I can clone and repro?

aemaghrabi commented 8 years ago

@filipesilva I think the only difference is the verstion of nodejs and of course the build error, here the result after apply ng -vcommand

angular-cli: 1.0.0-beta.6
node: 6.2.2
os: win32 x64

Also path f:\Work\Upwork\Tony Capoli\ dose not has any special permissions, it's just normal path for filter my project by client. And I want to mention, if that make problem, drive f:\ is encrypted using windows BitLocker.

Any way this is a repo for the project: https://github.com/EgyTechnology/test-ang-cli

hengbenkeji commented 8 years ago

I have the same issue with a different nodejs version:

angular-cli: 1.0.0-beta.6 node: 5.6.0 os: win32 x64

I tried angular-cli@1.0.0-beta.4 by issuing npm install -g angular-cli@1.0.0-beta.4 I but got the same error. What the hell is The Broccoli Plugin?

kurtinatlanta commented 8 years ago

I get the same problem on a Mac after following the instructions to reinstall angular-cli, re-run ng init etc.

My environment: angular-cli: 1.0.0-beta.8 node: 4.4.3 os: darwin x64

I had to change line 414 in angular-cli/lib/broccoli/broccoli-typescript.js to look like this to skip directories: if (!fs.existsSync(absoluteTsFilePath) || fs.statSync(absoluteTsFilePath).isDirectory()) {

I can fork and do a PR if you want.

Actually, my issue went away after a few more iterations over the instructions. If it crops up again, I'll try to gather more detail.

kurtinatlanta commented 8 years ago

I got it again. Here is more data:

We are trying to use the same techniques Angular is using with an @ name for our library and then using the paths entry in tsconfig.json to allow our code inside our library to use @library/whatever in our imports, just like an external user would.

When I tried to use import {Something} from '@library/core'; in my code, tsc --watch is happy, but ng build is not, giving me the error.

In our tsconfig.json, paths looks like this: "paths": { "@library/": [ "./" ] }

And the error I get from ng build (broccoli-typescript.js) is this (I added logging to print the directory name): CustomLanguageServiceHost.getScriptSnapshot(): absoluteTSFilePath = [/Users/hoytk/git/library/tmp/broccoli_type_script_compiler-input_base_path-I0dQTsQq.tmp/0/src/core]

where src/core is what @library/core gets translated into (correctly), but it's trying to run the compiler on the actual directory rather than the files in the directory.

Don't know if this helps pinpoint the problem, but in my case, it makes it happen every time.

angular-cli: 1.0.0-beta.8 node: 4.4.3 os: darwin x64

aemaghrabi commented 8 years ago

Hello guys, I found that CLI work perfectly under c:/ drive only

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.